Skip to content

Instantly share code, notes, and snippets.

@mikelovesrobots
Created June 19, 2013 05:23
Show Gist options
  • Save mikelovesrobots/5811851 to your computer and use it in GitHub Desktop.
Save mikelovesrobots/5811851 to your computer and use it in GitHub Desktop.
Just because Apple/Objective-C wants you to put everything in one goddamn file doesn't mean you actually have to have it all in one file.
//
// MapViewController.m
// placesihavepooped
//
// Created by Michael Judge on 6/16/13.
// Copyright (c) 2013 Michael Judge. All rights reserved.
//
#import "MapViewController.h"
@implementation MapViewController
@synthesize mkMapView;
- (void)viewDidLoad
{
[super viewDidLoad];
dropMarkerAction = [[DropMarkerAction alloc] init];
shareAction = [[ShareAction alloc] init];
initialZoomAction = [[InitialZoomAction alloc] init];
annotationViewGenerator = [[AnnotationViewGenerator alloc] init];
}
- (IBAction)bombsAwayAction:(id)sender {
[dropMarkerAction activate:mkMapView];
}
- (IBAction)shareAction:(id)sender {
[shareAction activate:self];
}
- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation {
[initialZoomAction activate:mapView andLocation:userLocation];
}
- (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(id)annotation
{
return [annotationViewGenerator generate:mapView viewForAnnotation:annotation];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment