小编Yas*_*hna的帖子

CLLocationManager.requestLocation()大约需要10秒

CLLocationManager.requestLocation()大约需要10秒才能开火didUpdateLocations.

以下是为其设置的属性 CLLocationManager

let locationManager = CLLocationManager()
locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.distanceFilter = 10
locationManager.requestWhenInUseAuthorization()
locationManager.requestLocation()
Run Code Online (Sandbox Code Playgroud)

根据文档,这可能需要几秒钟.

此方法立即返回.调用它会导致位置管理器获取位置修复(可能需要几秒钟)并使用结果调用委托的locationManager(_:didUpdateLocations :)方法.

但这需要10秒钟吗?或者我错过了什么?

gps core-location ios swift

11
推荐指数
2
解决办法
3084
查看次数

标签 统计

core-location ×1

gps ×1

ios ×1

swift ×1