Found out, obviously the didStartMonitoringForRegion delegate function is the right place to ask for requestStateForRegion:func locationManager(manager: CLLocationManager, didStartMonitoringForRegion region: CLRegion) { locationManager.requestStateForRegion(region) } 糟糕的是,我仍然需要短暂的延迟,或者有时不调用 requestStateForRegion : Awful thing is, I still need a short delay or sometimes requestStateForRegion is not called:func locationManager(manager: CLLocationManager, didStartMonitoringForRegion region: CLRegion) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, Int64(0.1 * Double(NSEC_PER_SEC))), dispatch_get_main_queue()) { self.locationManager.requestStateForRegion(region) }}:( 这篇关于Swift中startMonitoringForRegion之后的RequestStateForRegion的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-10 10:09