![](/img/trans.png)
[英]In iOS 16, attemptRotationToDeviceOrientation func is deprecated,Is there an alternative method?
[英]regionCode will be deprecated in iOS 16
iOS 16及更早版本解決方案
let locale = Locale.current
var countryCode = ""
if #available(iOS 16, *) {
if let value = locale.region?.identifier {
countryCode = value
}
} else {
if let value = locale.regionCode {
countryCode = value
}
}
print(countryCode)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.