Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use the users iOS currency settings

Tags:

ios

swift

I'm working with currency in an app and instead of listing out supported currencies or using Locale.isoCurrencyCodes to list out all currencies supported by iOS I would like to just use the currency that the user selects as their default system currency.

Is there a good way to do this or what's the best way to support multiple currencies in an iOS app?

For added context the application is written in Swift.

like image 853
glob Avatar asked Oct 20 '25 05:10

glob


1 Answers

Local currency code:

let usrRegionCode = Locale.current.currencyCode!

E.g.: "USD"


Local currency symbol:

let usrRegionCode = Locale.current.currencySymbol!

E.g.: "$"

like image 64
Eric Hua Avatar answered Oct 21 '25 20:10

Eric Hua



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!