Instance Method

setUserTrackingMode:animated:

Sets the mode used to track the user location with optional animation.

Declaration

- (void)setUserTrackingMode:(MKUserTrackingMode)mode animated:(BOOL)animated;

Parameters

mode

The mode used to track the user location. Possible values are described in MKUserTrackingMode.

animated

If YES, the change from the current mode to the new mode is animated; otherwise, it is not. This parameter affects only tracking mode changes. Changes to the user location or heading are always animated.

Discussion

Setting the tracking mode to MKUserTrackingModeFollow or MKUserTrackingModeFollowWithHeading causes the map view to center the map on that location and begin tracking the user’s location. If the map is zoomed out, the map view automatically zooms in on the user’s location, effectively changing the current visible region.

See Also

Displaying the User’s Location

Converting a User's Location to a Descriptive Placemark

Transform the user’s location displayed on a map into an informative description.

showsUserLocation

A Boolean value indicating whether the map should try to display the user’s location.

userLocationVisible

A Boolean value indicating whether the device’s current location is visible in the map view.

userLocation

The annotation object representing the user’s current location.

userTrackingMode

The mode used to track the user location.

MKUserTrackingMode

The mode used to track the user location on the map.