Instance Method

reverseGeocodeLocation(_:completionHandler:)

Submits a reverse-geocoding request for the specified location.

Declaration

func reverseGeocodeLocation(_ location: CLLocation, completionHandler: @escaping CLGeocodeCompletionHandler)

Parameters

location

The location object containing the coordinate data to look up.

completionHandler

A block object containing the code to execute at the end of the request. This code is called whether the request is successful or unsuccessful.

Discussion

This method submits the specified location data to the geocoding server asynchronously and returns. Your completion handler block will be executed on the main thread. After initiating a reverse-geocoding request, do not attempt to initiate another reverse- or forward-geocoding request.

Geocoding requests are rate-limited for each app, so making too many requests in a short period of time may cause some of the requests to fail. When the maximum rate is exceeded, the geocoder passes an error object with the value network to your completion handler.

See Also