I'm also seeing this issue becoming increasingly common, especially with Complications. I'm working around it like so:
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
if let location = manager.location as CLLocation? {
if location.coordinate.latitude == 0 {
return
}
locationManager.stopUpdatingLocation()
// do stuff with location
}
}
With the early return, didUpdateLocations might be called multiple times. In my testing, I always get a valid location after a few tries. I've been logging it, and usually didUpdateLocations only gets called twice, but I've seen it up to 5 times, all within the same second, before returning a valid location.
Topic:
App & System Services
SubTopic:
Maps & Location
Tags: