When we range beacons using the
locationManager:didRangeBeacons:inRegion method of
CLLocationManager, we're given a collection of beacons (
CLBeacon). In order to understand the distance of the beacon from our device, the
CLBeacon class gives us two properties:
proximityproperty gives you the distance from the device using the
CLProximityenum, giving one of four values
accuracyproperty gives you the distance from the device as a double value, which is the distance measured in meters. If the distance cannot be determined, the value is returned as negative.
CLProximity enum values represent the approximate distance from the device in four bands and are great to determine when to perform an action.
Imagine you're building an app for a museum. Your app tells users about the individual cabinets within different exhibits as visitors walk through. If your visitor...