Skip to content

Instantly share code, notes, and snippets.

@coledennis
Created September 21, 2022 13:14
Show Gist options
  • Save coledennis/4fed710c4b5423521f5ea2c5071e9f3a to your computer and use it in GitHub Desktop.
Save coledennis/4fed710c4b5423521f5ea2c5071e9f3a to your computer and use it in GitHub Desktop.
func locationManagerDidChangeAuthorization(_ manager: CLLocationManager) {
switch manager.authorizationStatus {
case .authorizedWhenInUse: // Location services are available.
// Insert code here of what should happen when Location services are authorized
break
case .restricted, .denied: // Location services currently unavailable.
// Insert code here of what should happen when Location services are NOT authorized
break
case .notDetermined: // Authorization not determined yet.
manager.requestWhenInUseAuthorization()
break
default:
break
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment