Ios – difference between startMonitoringSignificantLocationChanges() and startUpdatingLocation() method of CLLocationManager

cllocationcllocationmanageriosobjective cswift

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?

Best Answer

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.

Related Topic