---
title: "deselectAnnotation(_:animated:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmapview/deselectannotation(_:animated:)"
---

# deselectAnnotation(_:animated:)

Deselects the specified annotation and hides its callout view.

## Declaration

```swift
func deselectAnnotation(_ annotation: (any MKAnnotation)?, animated: Bool)
```

## Parameters

- `annotation`: The annotation object to deselect.
- `animated`: If doc://com.apple.documentation/documentation/Swift/true, the map view animates the callout view offscreen.

## See Also

### Managing annotation selections

- [annotationVisibleRect](mapkit/mkmapview/annotationvisiblerect.md)
- [selectedAnnotations](mapkit/mkmapview/selectedannotations.md)
- [selectAnnotation(_:animated:)](mapkit/mkmapview/selectannotation(_:animated:).md)
