Instance Method

locationManager(_:didChangeAuthorization:)

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

Declaration

optional func locationManager(_ manager: CLLocationManager, didChangeAuthorization status: CLAuthorizationStatus)

Parameters

manager

The location manager object reporting the event.

status

The new authorization status for the application.

Discussion

This method is called whenever the application’s ability to use location services changes. Changes can occur because the user allowed or denied the use of location services for your application or for the system as a whole.

If the authorization status is already known when you call the requestWhenInUseAuthorization() or requestAlwaysAuthorization() method, the location manager does not report the current authorization status to this method. The location manager only reports changes to the authorization status. For example, it calls this method when the status changes from CLAuthorizationStatus.notDetermined to CLAuthorizationStatus.authorizedWhenInUse.

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