CLLocationManager reverseGeocodeLocation Language

Viewed 1693

I'm using CLLocationManager on iPhone to get the current user location, then I use reverseGeocodeLocation to convert the location to an address.

This works fine but the results are returned in the device language and I need them to always be in english.

Is there a way to get the Address string in a desired language or convert it ?

    [geocoder reverseGeocodeLocation:currentLocation completionHandler:^(NSArray *placemarks, NSError *error) {
        NSLog(@"Found placemarks: %@, error: %@", placemarks, error);
        if (error == nil && [placemarks count] > 0) {
            placemark = [placemarks lastObject];
    }
2 Answers

CLGeocoder provides a handy method for this exact case:

- (void)reverseGeocodeLocation:(CLLocation *)location 
               preferredLocale:(NSLocale *)locale 
             completionHandler:(CLGeocodeCompletionHandler)completionHandler;

Available in iOS 11 and above.

Related