Getting and Managing Location Updates

As long as the players are more than 10 meters away from the place where the text is drawn, they should see a screen showing the distance to that location. Using this information, they have to find the text’s location. As soon as the players get within 10 meters of the text, they will see the AR view on their screen and they can search for the text.

As we did in the previous chapters, let’s add a class that manages the location updates from the GPS sensor. Use the shortcut N to add a new Cocoa Touch class, call it LocationProvider, and make it a subclass of NSObject.

Import CoreLocation and the LogStore logging library into LocationProvider.swift:

 import ...

Get Build Location-Based Projects for iOS 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.