---
title: "mapView(_:didUpdate:)"
framework: mapkit
role: symbol
role_heading: Instance Method
path: "mapkit/mkmapviewdelegate/mapview(_:didupdate:)"
---

# mapView(_:didUpdate:)

Tells the delegate when the map view updates the user’s location.

## Declaration

```swift
optional func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation)
```

## Parameters

- `mapView`: The map view that’s tracking the user’s location.
- `userLocation`: The location object representing the user’s latest location. This property may be nil.

## Mentioned in

Converting a user’s location to a descriptive placemark

## Discussion

Discussion While the showsUserLocation property is true, the map view calls this method whenever it receives a new location update. It also calls this method if the map view’s user-tracking mode is MKUserTrackingMode.followWithHeading and the heading changes. The.map view doesn’t call this method if the app is running in the background. If you want to receive location updates while running in the background, use the Core Location framework.

## See Also

### Tracking the user’s location

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