Graphics Programs Reference
In-Depth Information
Updating Whereami
Every
MKMapView
has a
mapType
property that specifies whether it shows roads, satel-
lite imagery, or both. You will allow the user to change this property by adding a
UISeg-
mentedControl
that toggles the map type. The user's choice will be saved as a prefer-
ence, and the next time the application is launched, the preferred type of map will be dis-
played.
Open the
Whereami
project. Then open
WhereamiViewController.xib
and add a
UISegmentedControl
to the interface. Change its style and number of segments to
what is shown in
Figure 18.1
.
Figure 18.1 UISegmentedControl attributes
Make an outlet and an action connection between this object and the
Wheream-
iViewController
(
Figure 18.2
). The outlet will be a weak instance variable.
Figure 18.2 Adding to Whereami's interface