Contents

setUserTrackingMode(_:animated:)

Sets the map’s tracking mode.

Declaration

func setUserTrackingMode(_ mode: WKInterfaceMap.UserTrackingMode, animated: Bool)

Parameters

  • mode:

    The desired tracking mode. For a complete list of valid tracking modes, see Usertrackingmode.

  • animated:

    A Boolean value that indicates whether the map animates the change to the tracking mode.

Discussion

By default, the tracking mode is WKInterfaceMap.UserTrackingMode.none.

Setting the tracking mode to WKInterfaceMap.UserTrackingMode.follow causes the map to center on the user’s location and begin tracking the user. 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