如下所示,对货币代码的简单请求应返回货币代码,但返回nil.我是否需要在申请货币代码之前设置区域,或者是否有我遗漏的东西.我在我的模拟器上使用Swift 3.1和Xcode 8.3.3 iphone 6和相同的结果.
if let currencyCode = Locale.current.currencyCode {
print(currencyCode)
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
186 次 |
| 最近记录: |