美文网首页
iOS 国家代码查询和国家名字打印

iOS 国家代码查询和国家名字打印

作者: 秋叶红90 | 来源:发表于2021-04-15 13:55 被阅读0次
let countryArr = Locale.isoRegionCodes
 
        let locale = Locale.current
        if let code = locale.regionCode {
            
            print("locale  \(locale.localizedString(forRegionCode: code))")
        }
        print("countryArr  \(countryArr)")
        for item in countryArr {
             
            let name = locale.localizedString(forRegionCode: item)
            print("name  \(name)")
        }

相关文章

网友评论

      本文标题:iOS 国家代码查询和国家名字打印

      本文链接:https://www.haomeiwen.com/subject/kymdlltx.html