I have downloaded the last version of XCode to test my project in iOs 10 Beta. When I have opened it, XCode asked me if I wanted to convert my project to Swift 3. After doing that, one error appeared :
Cannot override 'locationManager' which has been marked unavailable: APIs deprecated as of iOS 7 and earlier are unavailable in Swift
And my code is the following :
func locationManager(_ manager: CLLocationManager, didUpdateToLocation newLocation: CLLocation, fromLocation oldLocation: CLLocation) {
locationManager.stopUpdatingLocation()
currentUserLocation = newLocation
}
Is there another "not deprecated" function to achieve the same result ?
Thanks!
This method replaced the one you're using:
func locationManager(_ manager: CLLocationManager,
didUpdateLocations locations: [CLLocation]) {
}
Find out more here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With