Monitor the Current Location’s Distance from the Destination

In other books and in my classes, I show developers how to add a fun feature to the RoadTrip app. When the user shakes the device, a semitransparent window drops down from the top of the screen and displays the distance for either a found location or the final destination. You add this feature by using the accelerometer and core location frameworks.

If the user finds this feature annoying — and because this added feature can chew up the battery life — you want to offer the user the option to toggle it on and off. See the earlier section, “Add Preferences.”

Get iPad Application Development For Dummies, 3rd Edition 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.