【发布时间】:2018-03-01 00:25:44
【问题描述】:
我的应用高度基于CLLocation 时间戳。我发现CLLocationManager 每隔约 1 秒更新一次位置。这对我的应用程序来说还不够。是否可以配置CLLocationManager 以更短的时间间隔更新位置,或者我应该寻找其他方法(计时器+手动询问位置)?
locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation
locationManager.allowsBackgroundLocationUpdates = true
locationManager.distanceFilter = kCLDistanceFilterNone
if #available(iOS 11.0, *) {
locationManager.showsBackgroundLocationIndicator = true
}
locationManager.startUpdatingLocation()
计时器 + requestLocation() 不起作用。
【问题讨论】:
标签: ios swift gps core-location