Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is difference between startMonitoringSignificantLocationChanges() and startUpdatingLocation() method of CLLocationManager?

I'm working with CLLocationManager class. I want to get location updates periodically. I had found two methods to get location in didUpdateLocations method, that are startUpdatingLocation() and startMonitoringSignificantLocationChanges(). If I have to track location updates in foreground mode also then which method should I use?

like image 711
Bhawna Raheja Avatar asked Feb 09 '16 06:02

Bhawna Raheja


1 Answers

The most important difference between the 2 is this:

startMonitoringSignificantLocationChanges: it does not rely on the value in the distanceFilter property to generate events. The receiver generates update events only when a significant change in the user’s location is detected

startUpdatingLocation : the receiver generates update events primarily when the value in the distanceFilter property is exceeded

So, if you want more precision, go for startUpdatingLocation, at the expense of more battery consumption, but more precision of the location. It really depends on your goal, you should evaluate the tradeoff.

like image 151
Guy Daher Avatar answered Sep 28 '22 07:09

Guy Daher