Reputation: 451
I'm currently trying to find a way to detect when the MKUserTrackingBarButtonItem
is used, other than deal with the mapView:didUpdateUserLocation:
delegate method.
I tried to setAction of the MKUserTrackingBarButtonItem
to call my function (check this thread), but of curse it removes the updating location action, which I don't want.
I don't find any delegate method triggered :/
Thanks for any idea.
Upvotes: 5
Views: 1532
Reputation: 8304
If your MKUserTrackingBarButtonItem
has been assigned a MKMapView
to operate on then the map view's delegate will receive mapView:didChangeUserTrackingMode:animated:
when the tracking mode is changed (which is done by pressing that button).
Upvotes: 10