Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Move removeRouteFromMap to superclass, MapVC

  • Loading branch information...
commit 92c26e71f8ca63deae297a2593ce45e44b01b690 1 parent 1367f4a
@timarnold authored
View
1  Routes/TAMapViewController.h
@@ -26,6 +26,7 @@
@property (nonatomic, strong) CLLocationManager *locationManager;
@property (nonatomic, strong) MKUserTrackingBarButtonItem *trackingBBI;
+- (void)removeRouteFromMap;
- (void)addStartPinWithLocation:(CLLocation *)loc;
- (void)addEndPinWithLocation:(CLLocation *)loc;
- (void)zoomMapToLocation:(CLLocationCoordinate2D)coord;
View
16 Routes/TAMapViewController.m
@@ -25,7 +25,21 @@ - (void)viewDidLoad {
[_locationManager startUpdatingLocation];
}
-#pragma mark - Private helper functions
+#pragma mark - Class methods
+
+- (void)removeRouteFromMap {
+ if (nil != self.crumbs) {
+ [self.mapView removeOverlay:self.crumbs];
+ self.crumbs = nil;
+ self.crumbView = nil;
+ }
+ if (nil != self.endPin) {
+ [self.mapView removeAnnotation:self.endPin];
+ }
+ if (nil != self.startPin) {
+ [self.mapView removeAnnotation:self.startPin];
+ }
+}
- (void)addEndPinWithLocation:(CLLocation *)loc {
if (nil == self.endPin) {
View
14 Routes/TARecordViewController.m
@@ -68,20 +68,6 @@ - (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event {
#pragma mark - Private helper functions
-- (void)removeRouteFromMap {
- if (nil != self.crumbs) {
- [self.mapView removeOverlay:self.crumbs];
- self.crumbs = nil;
- self.crumbView = nil;
- }
- if (nil != self.endPin) {
- [self.mapView removeAnnotation:self.endPin];
- }
- if (nil != self.startPin) {
- [self.mapView removeAnnotation:self.startPin];
- }
-}
-
- (void)dismissRoutesVC:(id)sender {
[self dismissViewControllerAnimated:YES completion:^{ }];
}
Please sign in to comment.
Something went wrong with that request. Please try again.