Created
October 2, 2012 12:20
-
-
Save wbroek/3818598 to your computer and use it in GitHub Desktop.
iOS 6 open Maps with route
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Class MKMapItemClass = [MKMapItem class]; | |
if (MKMapItemClass && [MKMapItemClass respondsToSelector:@selector(openMapsWithItems:launchOptions:)]) { | |
CLLocationCoordinate2D endCoord = { 54.0696, 50.3616 }; | |
MKPlacemark *endLocation = [[MKPlacemark alloc] initWithCoordinate:endCoord addressDictionary:nil]; | |
MKMapItem *endingItem = [[MKMapItem alloc] initWithPlacemark:endLocation]; | |
NSMutableDictionary *launchOptions = [[NSMutableDictionary alloc] init]; | |
[launchOptions setObject:MKLaunchOptionsDirectionsModeDriving forKey:MKLaunchOptionsDirectionsModeKey]; | |
[endingItem openInMapsWithLaunchOptions:launchOptions]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment