We have previously looked at how to use region monitoring with iBeacons using a CLBeaconRegion. Today we’ll look at the CLCircularRegion for region monitoring. There are some similarities between the CLBeaconRegion and CLCircularRegion. Both inherit from CLRegion which means there are some aspects that they share. In our iBeacons tutorial we created region monitoring which looks out for bluetooth transmitters called iBeacons. When the app detects the iBeacon it triggers a delegate method to be called which allows you to inspect a major and minor value to know which region was triggered. You can program the app to detect when you come in to range, or when you leave range.
With the CLCircularRegion we use geo location instead of bluetooth signals. This allows us to create geo fences which are defined by a centre point on a map along with a radius. When the phone passes in or out of the CLCircularRegion, the appropriate delegate method is fired and your app can be programmed to act accordingly. Common uses include controlling a smart home and setting a geo fence which when you leave the fence, it switches off your heating. Popular todo task manager apps, such as OmniFocus, use geo fences to let you know when you enter a region on a map where you need to perform a task.
In todays tutorial we’ll look at how to create a CLCircularRegion and how to start monitoring for that region. [Read more…]