MKAnnotationView is part of Apple's Map Kit framework for developing iOS applications, an object that represents annotations visually in a map view.
Annotation views are loosely coupled to a corresponding annotation object, which is an object that corresponds to the MKAnnotation
protocol. When an annotation’s coordinate point is in the visible region, asks its delegate to provide a corresponding annotation view. Alternatively (and simpler in many cases), you can simply register an particular annotation view with a particular identifier (notably the MKMapViewDefaultAnnotationViewReuseIdentifier
and MKMapViewDefaultClusterAnnotationViewReuseIdentifier
identifiers). Annotation views may be recycled later and put into a reuse queue that is maintained by the map view
Annotation views remain anchored to the map at the point specified by their associated annotation object. Although they scroll with the map contents, annotation views reside in a separate display layer and are not scaled when the size of the visible map region changes.
You can use the MKAnnotationView
class as-is, use an existing subclass (such as MKMarkerAnnotationView
), or subclass it yourself to provide custom behavior as needed. The image property of the class lets you set the appearance of the annotation view without subclassing directly.
See also
MKAnnotationView
documentation