如何从CurrencyCode获取CountryCode

时间:2018-01-07 13:01:27

标签: swift foundation

有没有办法从CurrencyCode获取CountryCode?大多数资源herehere演示了从countryCode获取currencyCode,或者使用currentLocale获取countryCode。

到目前为止我的代码:

let locale = NSLocale(localeIdentifier: "CNY")
print(locale.displayName(forKey: NSLocale.Key.countryCode, value: "CNY"))

请注意,我没有使用currentLocale来获取countryCodes,因为货币与位置无关。感谢。

0 个答案:

没有答案
相关问题