Created
September 6, 2020 14:06
-
-
Save janakaaleph/e1f0c4503f9b89456183b90fab32ee44 to your computer and use it in GitHub Desktop.
Code snippets from Praveen Kumar's article: https://medium.com/aleph-universe/whats-new-in-location-ios-14-9920ae42ba5c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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