阅读背景:

如何在所有viewDidLoad内容加载之前获取CLLocationManager结果?

来源:互联网 

Please check the code:

请检查代码:

 let manager = CLLocationManager()

//Location manager to determine the current location
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
    let location = locations[0]
    lat = location.coordinate.latitude
    lon = location.coordinate.longitude
    let currentLocation = CLLocation(latitude: lat!, longitude: lon!)
}
 let manager 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: