<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "visionOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MapKit",
  "identifier" : "/documentation/MapKit/MKMapViewDelegate/mapView(_:selectionAccessoryFor:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "MapKit"
    ],
    "preciseIdentifier" : "c:objc(pl)MKMapViewDelegate(im)mapView:selectionAccessoryForAnnotation:"
  },
  "title" : "mapView(_:selectionAccessoryFor:)"
}
-->

# mapView(_:selectionAccessoryFor:)

Specifies the accessory to display for a selected annotation

```
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`](/documentation/MapKit/MKMapItemAnnotation) and [`MKMapFeatureAnnotation`](/documentation/MapKit/MKMapFeatureAnnotation). Please return `nil` for annotations where a selection accessory is not desired.

No accessory will be displayed if…

- nil is returned
- [`mapView(_:selectionAccessoryFor:)`](/documentation/MapKit/MKMapViewDelegate/mapView(_:selectionAccessoryFor:)) is not implemented
- the accessory returned is not supported for `annotation`

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)