我下载了最新版本的XCode来测试我的项目在iOs 10 Beta中的情况。当我打开它时,XCode问我是否想将我的项目转换为Swift 3。在这样做之后,出现了一个错误:
无法覆盖已标记为不可用的'locationManager': iOS 7及更早版本的API已在Swift中不可用
而我的代码如下:
func locationManager(_ manager: CLLocationManager, didUpdateToLocation newLocation: CLLocation, fromLocation oldLocation: CLLocation) {
locationManager.stopUpdatingLocation()
currentUserLocation = newLocation
}
是否有另一个“未被弃用”的函数可以实现相同的结果?
谢谢!