Skip to content

Instantly share code, notes, and snippets.

@iosdevie
Created May 26, 2021 08:05
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 iosdevie/650f1e6fa1427deaa87c58b71f504713 to your computer and use it in GitHub Desktop.
Save iosdevie/650f1e6fa1427deaa87c58b71f504713 to your computer and use it in GitHub Desktop.
var locationManager = CLLocationManager()
locationManager.requestAlwaysAuthorization()
//or use requestWhenInUseAuthorization()
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.startUpdatingLocation()
locationManager.allowsBackgroundLocationUpdates = true
locationManager.pausesLocationUpdatesAutomatically = false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment