-
-
Save sturdysturge/a14a0ad45e82f955b89fba3c700d1a60 to your computer and use it in GitHub Desktop.
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
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