Location Access - How to access globally

Thank you for previously showing me how to get the lat and long from current location. The function you showed me did it one time, which is great.

In a different part of my app, I access location several times. I have put listeners on the all the pages where I need to get location, is that needed? Is there a way I can use a model or one page (even if its removed as a root view controller) to get location updates?

If someone moves with their phone, I need to access their new location on a certain screen.

Hi,
On the back of Kodika, the Location Manager is a singleton so even if you call the startLocationUpdates multiple times, it has no difference in the performance.
You can use Add Listener for Position Updates in your screens and then implement didUpdateLocation: in each of them and you will be fine. You need although to setup/start the Location Manager once.

Ok, this makes sense, thank you

1 Like