Search code examples
iosobjective-cmapkitmkusertrackingmode

Mapkit and userTrackingMode


I have a question about MapKit. I set the userTrackingMode property to move the map according to the user position update.

 [_mapView setUserTrackingMode:MKUserTrackingModeFollowWithHeading animated:YES];

Is there a way to be alerted when you exit from this mode?


Solution

  • From the Apple Docs on MKMapViewDelegate Protocol:

    mapView:didChangeUserTrackingMode:animated:
    Tells the delegate that the user tracking mode changed.

    • (void)mapView:(MKMapView *)mapView didChangeUserTrackingMode:(MKUserTrackingMode)mode animated:(BOOL)animated