Does anyone know if I can get the borough from a UK post code using CoreLocation framework? In the function listed below, the borough is not returned. It should return 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..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…