【发布时间】:2018-03-11 15:34:52
【问题描述】:
有谁知道我是否可以使用 CoreLocation 框架从英国邮政编码中获取自治市镇?在下面列出的函数中,不返回自治市镇。它应该返回 Tower Hamlets。
func getLocationFrom(postalCode : String){
let geocoder = CLGeocoder()
geocoder.geocodeAddressString(postalCode) {
(placemarks, error) -> Void in
let placemark = placemarks?[0]
print("placemark.addressDictionary are \(placemark.addressDictionary)") //does not print Canary Wharf
}
}
print(getLocationFrom(postalCode:"E14 9LR")) //does not print Tower Hamlets, it prints London, which is the city, not the borough..
【问题讨论】:
标签: swift core-location