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

# mapView(_:didChange:animated:)

Tells the delegate when the user-tracking mode changes.

## Declaration

```swift
optional func mapView(_ mapView: MKMapView, didChange mode: MKUserTrackingMode, animated: Bool)
```

## Parameters

- `mapView`: The map view where the user-tracking mode changes.
- `mode`: The mode to use for tracking the user’s location.
- `animated`: If doc://com.apple.documentation/documentation/Swift/true, the map animates the change from the current mode to the new mode; otherwise, the map doesn’t animate the change. This parameter affects only tracking-mode changes. The map animates all changes to the user’s location and heading.

## See Also

### Related Documentation

- [setUserTrackingMode(_:animated:)](mapkit/mkmapview/setusertrackingmode(_:animated:).md)

### Tracking the user’s location

- [mapViewWillStartLocatingUser(_:)](mapkit/mkmapviewdelegate/mapviewwillstartlocatinguser(_:).md)
- [mapViewDidStopLocatingUser(_:)](mapkit/mkmapviewdelegate/mapviewdidstoplocatinguser(_:).md)
- [mapView(_:didUpdate:)](mapkit/mkmapviewdelegate/mapview(_:didupdate:).md)
- [mapView(_:didFailToLocateUserWithError:)](mapkit/mkmapviewdelegate/mapview(_:didfailtolocateuserwitherror:).md)
