【发布时间】:2016-07-29 03:43:30
【问题描述】:
代码如下:
CLGeocoder().reverseGeocodeLocation(myCurrentLoc) { (array, err) in
print(err)
if err != nil {
print(err)
return
}
if let place = array?.first {
if let locality = place.locality {
if let country = place.country {
if let addr = place.addressDictionary {
print(addr)
}
let myAddress = "\(locality) \(country)"
self.adress.text = myAddress
self.locMgr.stopUpdatingLocation()
}
}
}
self.locMgr.stopUpdatingLocation()
}
所以我可以读取经度/纬度,而我唯一需要的是完整地址。现在我可以打印出“New York, US”,我发现我需要的所有信息都在原地。addressDictionary,这是一个字典。但我似乎无法使用正常语法从该字典中读取任何内容。我该怎么做?
【问题讨论】:
标签: ios swift xcode core-location