Protocol

CLLocationManagerDelegate

The methods that you use to receive events from an associated location manager object.

Declaration

@protocol CLLocationManagerDelegate

Overview

The location manager calls the methods of this delegate to report location-related events to your app. Implement this protocol in an app-specific object and use the methods to update your app. For example, you might use the current location to update the user’s position on a map or you might return search results relevant only to the user’s current location.

Assign your delegate object to the delegate property of the CLLocationManager object before starting any services. Core Location may report a cached value to your delegate immediately after you start the service, followed by a more current value later. Check the time stamp of any data objects you receive before using them.

The methods of your delegate object are called from the thread in which you started the corresponding location services. That thread must itself have an active run loop, like the one found in your application’s main thread.

Topics

Responding to Location Events

- locationManager:didUpdateLocations:

Tells the delegate that new location data is available.

- locationManager:didFailWithError:

Tells the delegate that the location manager was unable to retrieve a location value.

- locationManager:didFinishDeferredUpdatesWithError:

Tells the delegate that updates will no longer be deferred.

- locationManager:didUpdateToLocation:fromLocation:

Tells the delegate that a new location value is available.

Pausing Location Updates

- locationManagerDidPauseLocationUpdates:

Tells the delegate that location updates were paused.

- locationManagerDidResumeLocationUpdates:

Tells the delegate that the delivery of location updates has resumed.

Responding to Heading Events

- locationManager:didUpdateHeading:

Tells the delegate that the location manager received updated heading information.

- locationManagerShouldDisplayHeadingCalibration:

Asks the delegate whether the heading calibration alert should be displayed.

Responding to Region Events

- locationManager:didEnterRegion:

Tells the delegate that the user entered the specified region.

- locationManager:didExitRegion:

Tells the delegate that the user left the specified region.

- locationManager:didDetermineState:forRegion:

Tells the delegate about the state of the specified region.

- locationManager:monitoringDidFailForRegion:withError:

Tells the delegate that a region monitoring error occurred.

- locationManager:didStartMonitoringForRegion:

Tells the delegate that a new region is being monitored.

Responding to Ranging Events

- locationManager:didRangeBeacons:satisfyingConstraint:

Tells the delegate that a beacon satisfying the constraint was detected.

Beta
- locationManager:didFailRangingBeaconsForConstraint:error:

Tells the delegate that no beacons were detected that satisfy the constraint.

Beta
- locationManager:didRangeBeacons:inRegion:

Tells the delegate that one or more beacons are in range.

Deprecated
- locationManager:rangingBeaconsDidFailForRegion:withError:

Tells the delegate that an error occurred while gathering ranging information for a set of beacons.

Deprecated

Responding to Visit Events

- locationManager:didVisit:

Tells the delegate that a new visit-related event was received.

Responding to Authorization Changes

- locationManager:didChangeAuthorizationStatus:

Tells the delegate that the authorization status for the application changed.

Relationships

Inherits From

See Also

First Steps

Choosing the Authorization Level for Location Services

Choose the appropriate level of access to location data for your app.

Determining the Availability of Location Services

Determine which location services are active and available on the user’s device.

CLLocationManager

The object that you use to start and stop the delivery of location-related events to your app.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software