GoogleMaps Framework Reference

  • GMSGeocoder provides reverse geocoding functionality, converting coordinates into addresses.

  • It offers a shared instance through the geocoder method.

  • The reverseGeocodeCoordinate method handles the process of converting coordinates to addresses asynchronously.

  • Results are delivered via a completion handler in Objective-C or as an asynchronous return value in Swift.

GMSGeocoder

@interface GMSGeocoder : NSObject

Exposes a service for reverse geocoding. This maps Earth coordinates (latitude and longitude) to a collection of addresses near that coordinate.

  • Declaration

    Objective-C

    + (GMSGeocoder *)geocoder;
  • Reverse geocodes a coordinate on the Earth’s surface.

    Declaration

    Swift

    func reverseGeocodeCoordinate(_ coordinate: CLLocationCoordinate2D) async throws -> GMSReverseGeocodeResponse

    Objective-C

    - (void)reverseGeocodeCoordinate:(CLLocationCoordinate2D)coordinate
                   completionHandler:(nonnull GMSReverseGeocodeCallback)handler;

    Parameters

    coordinate

    The coordinate to reverse geocode.

    handler

    The callback to invoke with the reverse geocode results. The callback will be invoked asynchronously from the main thread.