MapKit, the Missing Part — Dance before Sherlocking comes
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


MapKit callbacks made easy. p.s. GOOD JOB MAPKIT TEAM, THE NEW MAP IS AWESOME!!


Look at the Sample App. It has a map view and three buttons.

What’s Inside

There’s an IRMapView, again a drop-in replacement for MKMapView. You can now do this (all code copied from the sample app):

[self.mapView setRegion:region animated:YES completion:^{

    [[[UIAlertView alloc] initWithTitle:@"Changed Region" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];


Not satisfied? How about this:

[self.mapView setCenterCoordinate:coordinate animated:YES completion:^{

    [[[UIAlertView alloc] initWithTitle:@"Changed Center Coordinate" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];


Or this:

[self.mapView setVisibleMapRect:MKMapRectWorld edgePadding:UIEdgeInsetsZero animated:YES completion:^{

    [[[UIAlertView alloc] initWithTitle:@"Changed Map Rect" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];


Yes, you can nest them. And, also yes, if you invoke these methods when the user is scrolling, IRMapView is polite enough to animate only after the user has finished scrolling. If you would rather not do anything, you can observe the (currently private) changingRegion property on the map view, which is a BOOL. It participates in KVO.


This project is in the public domain. You can use it and embed it in whatever application you sell, and you can use it for evil. However, it is appreciated if you provide attribution, by linking to the project page ( from your application.