A Word about Adding Settings

Although space doesn’t allow me to show you how to implement settings — for example, letting the user choose whether she wants to hear the car sound when she taps the Test Drive button, or to change the speed of the car — you implement such settings in exactly the same way that you just implemented the Destination preference. You add a setting to NSUserDefaults and create an RTAppDelegate property that you check in the car animation messages, for example, before you play the sound. To get even more sophisticated, you could create a Preferences class, in the same way you create a Trip class, that manages all preferences and uses that rather than the RTAppDelegate to provide Preference data to the rest of your app.

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.