Returns the view associated with the specified annotation object.
- iOS 3.0+
- macOS 10.9+
- Mac Catalyst 13.0+Beta
- tvOS 9.2+
The map view that requested the annotation view.
The object representing the annotation that is about to be displayed. In addition to your custom annotations, this object could be an
MKUserobject representing the user’s current location.
The annotation view to display for the specified annotation or
nil if you want to display a standard annotation view.
Rather than create a new view each time this method is called, call the
dequeue method of the
MKMap class to see if an existing annotation view of the desired type already exists. If one exists, update the returned view to reflect the attributes of the specified annotation and return it. If a view of the appropriate type does not exist, you should create one, configure it with the needed annotation data, and return it.
If the object in the
annotation parameter is an instance of the
MKUser class, you can provide a custom view to denote the user’s location. To display the user’s location using the default system view, return
If you do not implement this method, or if you return
nil from your implementation for annotations other than the user location annotation, the map view uses a standard pin annotation view.