Created
August 20, 2019 03:02
-
-
Save susanna2222/3fce77f57cd97808e7f878dbfc0e3d68 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 setupLocationManager(){ | |
| // set delegate for location manager | |
| if CLLocationManager.authorizationStatus() != CLAuthorizationStatus.authorizedAlways{ | |
| // Request to get alwayls location authorization | |
| locationManager.requestAlwaysAuthorization() | |
| } | |
| locationManager.delegate = self | |
| locationManager.distanceFilter = 1 | |
| locationManager.desiredAccuracy = kCLLocationAccuracyBest | |
| locationManager.allowsBackgroundLocationUpdates = true | |
| locationManager.pausesLocationUpdatesAutomatically = false | |
| locationManager.showsBackgroundLocationIndicator = true | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment