Book Image

iOS Programming Cookbook

Book Image

iOS Programming Cookbook

Overview of this book

Do you want to understand all the facets of iOS programming and build complex iOS apps? Then you have come to the right place. This problem-solution guide will help you to eliminate expensive learning curves and focus on specific issues to make you proficient at tasks and the speed-up time involved. Beginning with some advanced UI components such as Stack Views and UICollectionView, you will gradually move on to building an interface efficiently. You will work through adding gesture recognizer and touch elements on table cells for custom actions. You will work with the Photos framework to access and manipulate photos. You will then prepare your app for multitasking and write responsive and highly efficient apps. Next, you will integrate maps and core location services while making your app more secure through various encryption methods. Finally, you will dive deep into the advanced techniques of implementing notifications while working with memory management and optimizing the performance of your apps. By the end of the book, you will master most of the latest iOS 10 frameworks.
Table of Contents (22 chapters)
iOS Programming Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

Working with geofencing


Geofencing is the concept of being notified when a user enters or exits a specific region. This region can be, for example, a shopping mall to remind the user to buy some stuff or to perform any specific action. Many apps can be built on the concept of geofencing to remind or notify users when they enter or exit specific regions. In the following demo, we will build a sample screen that allows the user to register a new geofencing to the map. The user will be able to select a location on the map, a diameter of the region, when to be notified (upon entry or upon exit), and some notes to be displayed on the notification that will be fired when the user passes this region.

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:

  2. Add a new View Controller for adding geofencing to the map. Link a Show segue from the new plus button to the new view...