How to do it...

To add geofencing, perform the following steps:

  1. Open storyboard, drag a UIBarButtonItem and add it to the right of the Locate Me button. Change its type to the Add type:
  1. Add a new View Controller for adding geofencing to the map. Link a Show segue from the new plus button to the new view controller.
  2. Add a MKMapView so that the user can use it to pick a location and make it at the bottom with half of the screen.
  3. Add a UISegmentedControl at the top of the view with two segments. The first segment will be called Upon Entry and the second one Upon Exit. This will help the user to choose the type of geofencing.
  4. Below the segmented ...

Get iOS Programming Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.