difference between desiredAccuracy and distanceFilter

前端 未结 2 1711
猫巷女王i
猫巷女王i 2021-02-15 16:28

Sorry for being a noob here. I am not able to clearly differentiate between CLLocationManager\'s properties distanceFilter and desiredAccuracy.

2条回答
  •  别跟我提以往
    2021-02-15 17:33

    According to developer.apple.com

    distanceFilter

    The minimum distance (measured in meters) a device must move laterally before an update event is generated.

    That means, based on previous location event, another location update will only be received after exceeding distanceFilter value distance.

    desiredAccuracy refers to how accurate your location data should be. For example if you wish to see the exact street you're on you a high accuracy value for this parameter. (kCLLocationAccuracyBest) If you only wish to see the approximate area (such as in which neighbourhood you're in) you'd set a lower accuracy value for this param. (kCLLocationAccuracyThreeKilometers)

    Choose this to suit your needs, however be aware that the more precise you wish to be and the more often you request updates, the more power it will drain from your device.

    Hope this helps, Vlad

提交回复
热议问题