Improving Apps With Location Services

All iOS devices come with a huge variety of chips and sensors that can be used to enhance the user experience. Augmented reality applications make heavy use of sensors such as the gyroscope, accelerometer, and camera. These sensors are great if you want to grab a picture or want to know how a device is moving. Other apps require different data, like, for instance, the user's GPS location at a given time. In this chapter, you will learn how to use the CoreLocation framework to do just that.

Core Location is a framework that allows developers to gain access to a user's current location, but it also allows developers to track whether a user has entered or exited a specific area, or even to monitor a user's location over time. A proper implementation of Core Location can be the core of many great features in your app, but a lousy implementation could drain a user's battery in no time.

In this chapter, you will learn about the following location-related topics:

  • Requesting a user's location
  • Subscribing to location changes
  • Setting up geofences

If you want to follow along with the code samples and implementations that are provided throughout this chapter, make sure to grab the LocationServices start project from this book's code bundle. By the end of the chapter, you should be able to make educated decisions about how and when you implement Core Location in your apps.