Understanding and creating annotations
In Chapter 11, Finishing Up Your User Interface, you added a map view to the Map screen. A map view is an instance of the MKMapView
class. You can see what it looks like by going to the Apple Maps app.
Important information
To learn more about MKMapView
, see https://developer.apple.com/documentation/mapkit/mkmapview.
When you build and run your app, you will see a map on the screen. The part of the map that is visible onscreen can be specified by setting the region
property of the map.
Important information
To learn more about regions and how to make them, see https://developer.apple.com/documentation/mapkit/mkmapview/1452709-region.
Pins on the Map screen are used to mark specific locations and are instances of the MKAnnotationView
class. To add a pin to a map view, you need an object that conforms to the MKAnnotation
protocol. This protocol allows you to associate an object with a specific map location.
Important information...