---
title: "mapView(_:annotationView:didChange:fromOldState:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmapviewdelegate/mapview(_:annotationview:didchange:fromoldstate:)"
---

# mapView(_:annotationView:didChange:fromOldState:)

Tells the delegate when the drag state of one of its annotation views changes.

## Declaration

```swift
optional func mapView(_ mapView: MKMapView, annotationView view: MKAnnotationView, didChange newState: MKAnnotationView.DragState, fromOldState oldState: MKAnnotationView.DragState)
```

## Parameters

- `mapView`: The map view containing the annotation view.
- `view`: The annotation view whose drag state changed.
- `newState`: The new drag state of the annotation view.
- `oldState`: The previous drag state of the annotation view.

## Discussion

Discussion The drag state typically changes in response to user interactions with the annotation view. However, the annotation view itself is responsible for changing that state as well.
