If I init additional CLLocaitonManager instance that track user location, is It will increase the load? Or Should I using one CLLocaitonManager instance between classes?
If I init additional CLLocaitonManager instance that track user location, is It will increase
Share
Creating too many
CLLocationManageror increasing the update intervals of the Core location services severely drains battery. So creating too many instances is not advised. Dont see a need for this.A good practice is to init one
CLLocationManagerin a viewController. If moving to another viewController, then stopUpdates on the currentCLLocationManager& create a new manager in the new viewController. This is one pattern.Another pattern is to create a
CLLocationManagerin app delegate & make it available throughout your app. This is like a global variable. But generally avoid global declaration of this variable because it continuously consumes your battery life.So basically if all your classes are part of only one viewController then create only one
CLLocationManager& share the location updates. If not then create one for each viewController.