My iphone app supposed to resolve address based on latitude and longitude of the user. reverseGeocodeLocation works fine, but results are in english.
Is there a way to l
Solution for Swift 4, iOS 11
You can force to get geocoding results in chosen locale language by setting argument: preferredLocale: Locale.init(identifier: "en_US").
CLGeocoder().reverseGeocodeLocation(location, preferredLocale: Locale.init(identifier: "en_US"), completionHandler: {(placemarks, error) -> Void in
print(location)
if error != nil {
print("Reverse geocoder failed with error" + error!.localizedDescription)
return
}
if placemarks!.count > 0 {
let pm = placemarks![0]
print(pm.administrativeArea!, pm.locality!)
}
else {
print("Problem with the data received from geocoder")
}
})