cat如何获取didUpdateLocation委托的坐标位置?
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) 请帮帮me.Thanks
发布于 2017-12-08 16:59:20
这个问题的简单答案是:
(locations.first?.coordinate)!发布于 2017-12-08 16:58:49
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
location = locations.last!
}发布于 2017-12-08 16:59:07
请在发帖前做一些调查。
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let coordinate = locations.first?.coordinate
}位置管理器为您提供了一个位置数组,只需获取第一个位置,然后访问坐标属性即可。
https://stackoverflow.com/questions/47710748
复制相似问题