I am working on a sample map kit app for iOS. I have everything working and a toolbar button to toggle the MKUserTrackingMode. This may seem like a silly question but I have searched all the options in the IB and looked in the documentation, and I can't find any button options like the one for the current location/compass heading used in the iOS Maps app. Is that particular button available to developers?
You need to create a MKUserTrackingBarButtonItem and pass it the MKMapview in the constructor, then add that button item to the navigation menu (or where ever it is your button should be).
- (void)viewDidLoad
{
[super viewDidLoad];
MKUserTrackingBarButtonItem *buttonItem = [[MKUserTrackingBarButtonItem alloc] initWithMapView:self.map];
self.navigationItem.rightBarButtonItem = buttonItem;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With