StructureFoundationEssentials
Locale.Currency
iOS 16.0+
iPadOS 16.0+
Mac Catalyst 16.0+
macOS 13.0+
tvOS 16.0+
watchOS 9.0+
A type that represents the currency system used by a locale, like dollars or euros.
struct Currency
Topics
Operators
Initializers
init(String)Creates a currency instance from a BCP 47 identifier.init(from: any Decoder) throwsinit(stringLiteral: String)Creates a currency instance from a BCP 47 identifier as a string literal.
Instance Properties
var debugDescription: Stringvar identifier: StringThe currency’s identifier.var isISOCurrency: BoolA Boolean value that indicates whether the currency is in the list of ISO-defined currencies.
Instance Methods
Type Properties
static var isoCurrencies: [Locale.Currency]An array containing currencies defined by the currency codes in ISO-4217.static let unknown: Locale.CurrencyA representation of an “unknown” currency, for use with transactions that don’t involve any currency.
Relationships
Conforms To
Swift.CopyableSwift.CustomDebugStringConvertibleSwift.DecodableSwift.EncodableSwift.EquatableSwift.EscapableSwift.ExpressibleByExtendedGraphemeClusterLiteralSwift.ExpressibleByStringLiteralSwift.ExpressibleByUnicodeScalarLiteralSwift.HashableSwift.SendableSwift.SendableMetatype