Here is the scenario,I have added a today extension target to my app. And in my widget ViewController, it listens to location changes via Core Location framework.Also,there is location changes listener in my containing app.And I know there is a callback to get the latest location.
optional func locationManager(_ manager: CLLocationManager!,
didUpdateLocations locations: [AnyObject]!)
However,What I want to know is that when my containing app and widget is both running(sounds werid,assuming containing app is running in background),and they are both listening to location changes using CLLocationManager,does the method locationManager:didUpdateLocations: called at the same time and get the same location data or something else?( I know widget and app is running in separate process in advance) Thanks in advance. :-]
There is no guarantee that the updates will happen at the same time. It might be that they happen to be at the same time, but this is not guaranteed to be true, so you couldn't rely on it.
Assuming that the phone isn't moving too quickly, they'll probably get the same location, but there might be slight differences in when those updates are delivered to the apps.