Converting a User's Location to a Descriptive Placemark

Overview

You can show a user’s location on a map in order to orient them to elements of your app that use map content. For instance, a user’s current location can be a point of reference for retrieving search results or calculating directions. Additionally, you can display location information outside of the map, such as a search field pre-filled with the user’s current city or street address. To provide this information in your app, configure your map view to display the user’s location, and then translate the location to informative, user-friendly data.

Display the User Location Annotation

To provide user-friendly place information, configure your map view to display the user’s current location by enabling showsUserLocation. After enabling this property, the map delegate begins receiving updates to the user’s location, represented with a MKUserLocation object, through mapView:didUpdateUserLocation:.

Geocode the User Location Annotation

CLPlacemark objects represent user place names, and include properties for street name, city name, country name, and many other location identifiers. When mapView:didUpdateUserLocation: receives updates on the user’s location, convert the MKUserLocation object to a CLPlacemark by reverse geocoding the location property with a CLGeocoder. Readable descriptions of the user’s location are available as properties on the placemark, such as the city information stored in the locality property.

Important

Geocoding requests are rate-limited for each app. Issue new geocoding requests only when the user has moved a significant distance and after a reasonable amount of time has passed.