Exercises

1. Add a control to allow the user to change the accuracy setting for the sensor and notice how the output changes when moving about using different settings.

2. The app now has database access code in several view controllers. To support a cleaner design, add a database access class that controls all access to Core Data and provides useful methods and properties to the rest of the app.

3. Turn off the user’s permission to access location for the App (in the Simulator, go to Settings > Privacy > Location). Run the app again and observe what happens. Is this appropriate behavior? How could it be improved?

4. What would happen if the code in Listing 13.10 was placed in viewDidLoad: instead of viewWillAppear:?

5. Change the text displayed ...

Get Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android 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.