我遇到了这个Stackoverflow Thread about listing countries and it's calling codes using libPhoneNumber library
解决办法是这样的
Use the
getSupportedRegions()
method, then iterate these regions callinggetCountryCodeForRegion()
.
但是,接受的解决方案不适用于 iOS 版本的 libPhoneNumber。 getSupportedRegions()
在 iOS 版本上不可用
有什么想法可以在 iOS 使用 libPhoneNumber 中执行此操作吗?
最佳答案
解决方案是:
import libPhoneNumber_iOS
override func viewDidLoad() {
super.viewDidLoad()
let phoneUtil = NBPhoneNumberUtil()
let regions = phoneUtil.getSupportedRegions()
}
关于ios - 在 iOS 上使用 libPhoneNumber 列出所有国家/地区的代码和调用代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30979188/