Skip to content

Instantly share code, notes, and snippets.

View danielphillips's full-sized avatar

Daniel Phillips danielphillips

  • Trainline
  • London, UK
View GitHub Profile
@interface SomeViewController : UIViewController
@end
@implementation SomeViewController
- (IBAction)show:(id)sender
{
UIImagePickerController *pickerController = [UIImagePickerController new];
[pickerController setDelegate:(id)self];
- (IBAction)showWalkingDirections:(id)sender {
if ([self.parkingDetails.mapItem respondsToSelector:@selector(openInMapsWithLaunchOptions:)]) {
NSDictionary *launchOptions = @{
MKLaunchOptionsDirectionsModeKey : MKLaunchOptionsDirectionsModeWalking,
MKLaunchOptionsMapTypeKey : [NSNumber numberWithInt:MKMapTypeStandard]
};
[self.parkingDetails.mapItem openInMapsWithLaunchOptions:launchOptions];
} else {
NSString *mapURL = @"http://maps.google.com/maps?";