Skip to content

Instantly share code, notes, and snippets.

@janakaaleph
Created September 6, 2020 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janakaaleph/e1f0c4503f9b89456183b90fab32ee44 to your computer and use it in GitHub Desktop.
Save janakaaleph/e1f0c4503f9b89456183b90fab32ee44 to your computer and use it in GitHub Desktop.
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
switch manager.authorizationStatus() {
case .authorizedAlways:
print("Always authorized.")
case .authorizedWhenInUse:
print("Authorization granted only when app is in use.")
case .denied, .notDetermined, .restricted:
print("Not authorized.")
@unknown default:
print("Unknown.")
}
switch manager.accuracyAuthorization {
case .fullAccuracy:
print("User has granted full accuracy.")
case .reducedAccuracy:
print("User has only granted reduced accuracy.")
@unknown default:
print("Unknown.")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment