Contents

mapView(_:selectionAccessoryFor:)

Specifies the accessory to display for a selected annotation

Declaration

optional func mapView(_ mapView: MKMapView, selectionAccessoryFor annotation: any MKAnnotation) -> MKSelectionAccessory?

Parameters

  • mapView:

    The map view that requests the selection accessory.

  • annotation:

    The annotation.

Discussion

Called for all selected annotations. Not all types of annotations support displaying selection accessories. For example, the map item detail selection accessory is only supported for MKMapItemAnnotation and MKMapFeatureAnnotation. Please return `nil` for annotations where a selection accessory is not desired.

No accessory will be displayed if…

See Also

Managing the display of overlays