Reputation: 1002
Is there any way to get a currency name from the current Locale in swift? I'm not talking about the identifier or symbol (so not the "USD" or "$"). I'm looking for something like "American Dollars". Is that built in to swift or do I have to make my own list?
Upvotes: 1
Views: 210
Reputation: 130072
The functionality is accessible on Locale
:
let locale = Locale.current
print(locale.localizedString(forCurrencyCode: "USD")) // Optional("US Dollar")
Upvotes: 2