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 notDetermined to authorizedWhenInUse.