[英]CLLocationManagerDelegate method, locationManager:didUpdateLocations:
[英]CLLocationManagerDelegate -locationManager(_:startMonitoring:) not called when there is no network
当我在iPhone上开启飞行模式时,
func locationManager(_ manager: CLLocationManager, didExitRegion region: CLRegion)
不再被称为。 但是,当我关闭飞行模式时会呼叫此代表。
在CLLocationManager中正常吗? 或我的财产设置错误。
我已经设置了所有属性。
lazy var locationManager: CLLocationManager = {
let lm = CLLocationManager()
lm.allowsBackgroundLocationUpdates = true
lm.pausesLocationUpdatesAutomatically = false
lm.showsBackgroundLocationIndicator = true
lm.delegate = self
lm.requestAlwaysAuthorization()
let authorizationStatus = CLLocationManager.authorizationStatus()
for region in lm.monitoredRegions {
lm.stopMonitoring(for: region)
}
return lm
}()
和locationManager.startMonitoring(for: region)
飞行模式也会关闭GPS,因此是的,不会接收位置更新,因此不会调用CLLocationManagerDelegate
方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.