Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

MapKit, the Missing Part — Dance before Sherlocking comes

branch: develop

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 IRGeoHelper.xcodeproj
Octocat-spinner-32 IRGeoHelper
Octocat-spinner-32 IRGeoHelperTests
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
README.md

IRGeoHelper

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

Sample

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.

Licensing

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 (https://github.com/iridia/IRGeoHelper) from your application.

Credits

Something went wrong with that request. Please try again.