Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created February 6, 2021 22:09
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 sturdysturge/a14a0ad45e82f955b89fba3c700d1a60 to your computer and use it in GitHub Desktop.
Save sturdysturge/a14a0ad45e82f955b89fba3c700d1a60 to your computer and use it in GitHub Desktop.
import CoreLocation
extension String {
static let isKPH = "isKPH"
}
extension CLLocationManager {
func speed(multipliedBy multiplier: Double) -> Double {
return Double((location?.speed ?? 0.0) * multiplier)
}
func start(delegate: CLLocationManagerDelegate) {
self.delegate = delegate
requestWhenInUseAuthorization()
desiredAccuracy = kCLLocationAccuracyBest
startUpdatingLocation()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment