thecoolwinter
thecoolwinter

Reputation: 1002

Get currency name from Locale swift

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

Answers (1)

Sulthan
Sulthan

Reputation: 130072

The functionality is accessible on Locale:

let locale = Locale.current
print(locale.localizedString(forCurrencyCode: "USD")) // Optional("US Dollar")

Upvotes: 2

Related Questions