19Settings
Many applications include preferences that users can set. Whether users are picking the size of the text or storing usernames, there is a standard way of enabling iOS application preferences. In this chapter, you will use the NSUserDefaults class to add a preference to your Whereami application. This preference will specify the map type of the MKMapView.
Updating Whereami
Every MKMapView has a mapType property that specifies whether it shows roads, satellite imagery, or both. You will allow the user to change this property by adding a UISegmentedControl that toggles the map type. The user’s choice will be saved as a preference for the next time the application is launched.
Open the Whereami project. Then open MainWindow.xib and add ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access