From 6b45f8a47304625d07fae547509a3e976ad64a18 Mon Sep 17 00:00:00 2001 From: Seth Friedman Date: Tue, 18 Mar 2014 00:51:08 -0500 Subject: [PATCH 01/26] Add current direction button --- Music City Center.xcodeproj/project.pbxproj | 22 +++++++++++++------- Music City Center/Base.lproj/Main.storyboard | 21 +++++++++++++++++-- Music City Center/MCCFloorViewController.m | 22 ++++++++++++++++++-- Music City Center/MCCMapViewController.m | 1 + 4 files changed, 55 insertions(+), 11 deletions(-) diff --git a/Music City Center.xcodeproj/project.pbxproj b/Music City Center.xcodeproj/project.pbxproj index d8233e1..cd58206 100644 --- a/Music City Center.xcodeproj/project.pbxproj +++ b/Music City Center.xcodeproj/project.pbxproj @@ -125,6 +125,17 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 2D4FF35718D8019600A02B69 /* View Controllers */ = { + isa = PBXGroup; + children = ( + 4B8E50DF18A04A93009F4266 /* MCCMapViewController.h */, + 4B8E50E018A04A93009F4266 /* MCCMapViewController.m */, + 4BBE291B18A0CD3700C38EB7 /* MCCFloorViewController.h */, + 4BBE291C18A0CD3700C38EB7 /* MCCFloorViewController.m */, + ); + name = "View Controllers"; + sourceTree = ""; + }; 2DD8447218BC444C00B4296F /* Networking */ = { isa = PBXGroup; children = ( @@ -171,15 +182,12 @@ 4B8E50D018A04A93009F4266 /* Music City Center */ = { isa = PBXGroup; children = ( - 841DD66718B8B7F3009626B8 /* Nav */, + 841DD66718B8B7F3009626B8 /* Models */, + 2D4FF35718D8019600A02B69 /* View Controllers */, 2DD8447218BC444C00B4296F /* Networking */, 4B8E50D918A04A93009F4266 /* MCCAppDelegate.h */, 4B8E50DA18A04A93009F4266 /* MCCAppDelegate.m */, 4B8E50DC18A04A93009F4266 /* Main.storyboard */, - 4B8E50DF18A04A93009F4266 /* MCCMapViewController.h */, - 4B8E50E018A04A93009F4266 /* MCCMapViewController.m */, - 4BBE291B18A0CD3700C38EB7 /* MCCFloorViewController.h */, - 4BBE291C18A0CD3700C38EB7 /* MCCFloorViewController.m */, 4B8E50E218A04A93009F4266 /* Images.xcassets */, 4B8E50D118A04A93009F4266 /* Supporting Files */, 2D9F3ECF18A1D8F700AA3F6C /* UIView+Screenshot.h */, @@ -219,7 +227,7 @@ name = "Supporting Files"; sourceTree = ""; }; - 841DD66718B8B7F3009626B8 /* Nav */ = { + 841DD66718B8B7F3009626B8 /* Models */ = { isa = PBXGroup; children = ( 841DD66A18B8B8F4009626B8 /* MCCFloorPlanLocation.h */, @@ -241,7 +249,7 @@ 4BF4026218BE98210067AD1A /* MCCFloorPlanImage.h */, 4BF4026318BE98210067AD1A /* MCCFloorPlanImage.m */, ); - name = Nav; + name = Models; sourceTree = ""; }; /* End PBXGroup section */ diff --git a/Music City Center/Base.lproj/Main.storyboard b/Music City Center/Base.lproj/Main.storyboard index f539ca7..866bdbd 100644 --- a/Music City Center/Base.lproj/Main.storyboard +++ b/Music City Center/Base.lproj/Main.storyboard @@ -132,21 +132,38 @@ - + + + + + + + + + + + + - + diff --git a/Music City Center/MCCFloorViewController.m b/Music City Center/MCCFloorViewController.m index 94e47a5..dbcfb75 100644 --- a/Music City Center/MCCFloorViewController.m +++ b/Music City Center/MCCFloorViewController.m @@ -27,6 +27,9 @@ @interface MCCFloorViewController () @property (weak, nonatomic) IBOutlet MBXMapView *mapView; +@property (weak, nonatomic) IBOutlet UIButton *currentDirectionButton; + +@property (nonatomic, getter = isRouting) BOOL routing; @property (strong, nonatomic) NSString *currentFloor; @@ -80,7 +83,15 @@ - (void)setCurrentFloor:(NSString *)currentFloor { } -# pragma mark - View Controller Lifecycle + +#pragma mark - Custom Setter + +- (void)setRouting:(BOOL)routing { + _routing = routing; + self.currentDirectionButton.hidden = !routing; +} + +#pragma mark - View Controller Lifecycle - (void)viewDidLoad { [super viewDidLoad]; @@ -93,6 +104,8 @@ - (void)viewDidLoad { self.mapView.delegate = self; + self.routing = NO; + // self.mapView.mapType = MKMapTypeHybrid } @@ -107,6 +120,7 @@ - (void)setPolylineToFloorPlanLocation:(MCCFloorPlanLocation *)location andLocat // Save the incoming data self.endLocation = location; + [[MCCClient sharedClient] locationFromiBeacons:locationData forFloorPlan:floorPlanId withCompletionBlock:^(MCCFloorPlanLocation *floorPlanLocation) { @@ -121,7 +135,9 @@ -(void)setPolylineToFloorPlanLocation:(MCCFloorPlanLocation *)endLocation fromFl [self drawPolylineFromStartLocation:startLocation]; } -#pragma mark - MKMapViewDelegate + + +#pragma mark - Map View Delegate - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id)overlay { MKOverlayRenderer *renderer = nil; @@ -205,6 +221,8 @@ -(void)drawPolylineFromStartLocation:(MCCFloorPlanLocation *)startLocation { [self.mapView addOverlay:self.polyline]; + + self.routing = YES; }]; }]; diff --git a/Music City Center/MCCMapViewController.m b/Music City Center/MCCMapViewController.m index 1f2ec83..2f133f5 100644 --- a/Music City Center/MCCMapViewController.m +++ b/Music City Center/MCCMapViewController.m @@ -457,6 +457,7 @@ - (void)findMatches:(NSString *)searchText { } } + - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"PushMap"]) { if ([sender isKindOfClass:[MCCFloorPlanLocation class]]) { From 0cfca409280d6672c4de1d3a5e618cba10b892f0 Mon Sep 17 00:00:00 2001 From: Seth Friedman Date: Tue, 18 Mar 2014 01:15:42 -0500 Subject: [PATCH 02/26] Add Directions TVC when a user taps the current direction button on the Floor VC --- Music City Center.xcodeproj/project.pbxproj | 6 ++ Music City Center/Base.lproj/Main.storyboard | 66 +++++++++++++++++ .../MCCDirectionsTableViewController.h | 13 ++++ .../MCCDirectionsTableViewController.m | 73 +++++++++++++++++++ Music City Center/MCCFloorViewController.m | 5 ++ 5 files changed, 163 insertions(+) create mode 100644 Music City Center/MCCDirectionsTableViewController.h create mode 100644 Music City Center/MCCDirectionsTableViewController.m diff --git a/Music City Center.xcodeproj/project.pbxproj b/Music City Center.xcodeproj/project.pbxproj index cd58206..1d0a26b 100644 --- a/Music City Center.xcodeproj/project.pbxproj +++ b/Music City Center.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 2D4FF35F18D82FCD00A02B69 /* MCCSettingsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D4FF35E18D82FCD00A02B69 /* MCCSettingsTableViewController.m */; }; + 2D4FF35B18D816C200A02B69 /* MCCDirectionsTableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D4FF35A18D816C200A02B69 /* MCCDirectionsTableViewController.m */; }; 2D9F3ED118A1D8F700AA3F6C /* UIView+Screenshot.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D9F3ED018A1D8F700AA3F6C /* UIView+Screenshot.m */; }; 2DD8447518BC447000B4296F /* MCCResponseSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 2DD8447418BC447000B4296F /* MCCResponseSerializer.m */; }; 4B8E50CB18A04A93009F4266 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B8E50CA18A04A93009F4266 /* Foundation.framework */; }; @@ -52,6 +53,8 @@ 2394C53480684646969EDC29 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 2D4FF35D18D82FCD00A02B69 /* MCCSettingsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCCSettingsTableViewController.h; sourceTree = ""; }; 2D4FF35E18D82FCD00A02B69 /* MCCSettingsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCCSettingsTableViewController.m; sourceTree = ""; }; + 2D4FF35918D816C200A02B69 /* MCCDirectionsTableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCCDirectionsTableViewController.h; sourceTree = ""; }; + 2D4FF35A18D816C200A02B69 /* MCCDirectionsTableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MCCDirectionsTableViewController.m; sourceTree = ""; }; 2D9F3ECF18A1D8F700AA3F6C /* UIView+Screenshot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+Screenshot.h"; sourceTree = ""; }; 2D9F3ED018A1D8F700AA3F6C /* UIView+Screenshot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+Screenshot.m"; sourceTree = ""; }; 2DD8447318BC447000B4296F /* MCCResponseSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MCCResponseSerializer.h; sourceTree = ""; }; @@ -132,6 +135,8 @@ 4B8E50E018A04A93009F4266 /* MCCMapViewController.m */, 4BBE291B18A0CD3700C38EB7 /* MCCFloorViewController.h */, 4BBE291C18A0CD3700C38EB7 /* MCCFloorViewController.m */, + 2D4FF35918D816C200A02B69 /* MCCDirectionsTableViewController.h */, + 2D4FF35A18D816C200A02B69 /* MCCDirectionsTableViewController.m */, ); name = "View Controllers"; sourceTree = ""; @@ -404,6 +409,7 @@ 4BBE291D18A0CD3700C38EB7 /* MCCFloorViewController.m in Sources */, 2D9F3ED118A1D8F700AA3F6C /* UIView+Screenshot.m in Sources */, 841DD67E18B8BF6B009626B8 /* MCCClient.m in Sources */, + 2D4FF35B18D816C200A02B69 /* MCCDirectionsTableViewController.m in Sources */, 4BF4026418BE98210067AD1A /* MCCFloorPlanImage.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/Music City Center/Base.lproj/Main.storyboard b/Music City Center/Base.lproj/Main.storyboard index 866bdbd..6a693d2 100644 --- a/Music City Center/Base.lproj/Main.storyboard +++ b/Music City Center/Base.lproj/Main.storyboard @@ -142,6 +142,9 @@ + + + @@ -165,6 +168,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -388,6 +436,24 @@ + + + + + + + + + + + + + + + + + + diff --git a/Music City Center/MCCDirectionsTableViewController.h b/Music City Center/MCCDirectionsTableViewController.h new file mode 100644 index 0000000..486244b --- /dev/null +++ b/Music City Center/MCCDirectionsTableViewController.h @@ -0,0 +1,13 @@ +// +// MCCDirectionsTableViewController.h +// Music City Center +// +// Created by Seth Friedman on 3/18/14. +// Copyright (c) 2014 Music City Center. All rights reserved. +// + +#import + +@interface MCCDirectionsTableViewController : UITableViewController + +@end diff --git a/Music City Center/MCCDirectionsTableViewController.m b/Music City Center/MCCDirectionsTableViewController.m new file mode 100644 index 0000000..637aab4 --- /dev/null +++ b/Music City Center/MCCDirectionsTableViewController.m @@ -0,0 +1,73 @@ +// +// MCCDirectionsTableViewController.m +// Music City Center +// +// Created by Seth Friedman on 3/18/14. +// Copyright (c) 2014 Music City Center. All rights reserved. +// + +#import "MCCDirectionsTableViewController.h" + +@interface MCCDirectionsTableViewController () + +@property (nonatomic, copy) NSArray *directions; + +@end + +@implementation MCCDirectionsTableViewController + +#pragma mark - Custom Getter + +- (NSArray *)directions { + if (!_directions) { + _directions = @[@"Walk left until you reach something.", + @"Keep going until you reach something else.", + @"Turn left and go up the stairs.", + @"Keep turning and walking."]; + } + + return _directions; +} + +#pragma mark - View Controller Lifecycle + +- (void)viewDidLoad { + [super viewDidLoad]; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; + // Dispose of any resources that can be recreated. +} + +#pragma mark - Table View Data Source + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return [self.directions count]; +} + + +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + static NSString *cellIdentifier = @"DirectionCell"; + + UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier + forIndexPath:indexPath]; + + cell.textLabel.text = self.directions[indexPath.row]; + + return cell; +} + +/* +#pragma mark - Navigation + +// In a storyboard-based application, you will often want to do a little preparation before navigation +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender +{ + // Get the new view controller using [segue destinationViewController]. + // Pass the selected object to the new view controller. +} +*/ + +@end diff --git a/Music City Center/MCCFloorViewController.m b/Music City Center/MCCFloorViewController.m index dbcfb75..28aff8b 100644 --- a/Music City Center/MCCFloorViewController.m +++ b/Music City Center/MCCFloorViewController.m @@ -230,4 +230,9 @@ -(void)drawPolylineFromStartLocation:(MCCFloorPlanLocation *)startLocation { +#pragma mark - IB Action + +// Unwind segue +- (IBAction)directionsDone:(UIStoryboardSegue *)segue {} + @end From 8457c7eccd02070c8b2444525c9c64df0923b4e1 Mon Sep 17 00:00:00 2001 From: Seth Friedman Date: Tue, 18 Mar 2014 01:28:49 -0500 Subject: [PATCH 03/26] Add End button to turn off routing --- Music City Center/MCCFloorViewController.m | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/Music City Center/MCCFloorViewController.m b/Music City Center/MCCFloorViewController.m index 28aff8b..c0723d4 100644 --- a/Music City Center/MCCFloorViewController.m +++ b/Music City Center/MCCFloorViewController.m @@ -29,6 +29,8 @@ @interface MCCFloorViewController () @property (weak, nonatomic) IBOutlet MBXMapView *mapView; @property (weak, nonatomic) IBOutlet UIButton *currentDirectionButton; +@property (strong, nonatomic) UIBarButtonItem *endButton; + @property (nonatomic, getter = isRouting) BOOL routing; @property (strong, nonatomic) NSString *currentFloor; @@ -84,11 +86,25 @@ - (void)setCurrentFloor:(NSString *)currentFloor { +#pragma mark - Custom Getter + +- (UIBarButtonItem *)endButton { + if (!_endButton) { + _endButton = [[UIBarButtonItem alloc] initWithTitle:@"End" + style:UIBarButtonItemStyleBordered + target:self + action:@selector(endTapped:)]; + } + + return _endButton; +} + #pragma mark - Custom Setter - (void)setRouting:(BOOL)routing { _routing = routing; self.currentDirectionButton.hidden = !routing; + self.navigationItem.rightBarButtonItem = routing ? self.endButton : nil; } #pragma mark - View Controller Lifecycle @@ -230,7 +246,11 @@ -(void)drawPolylineFromStartLocation:(MCCFloorPlanLocation *)startLocation { -#pragma mark - IB Action +#pragma mark - IB Actions + +- (IBAction)endTapped:(UIBarButtonItem *)sender { + self.routing = NO; +} // Unwind segue - (IBAction)directionsDone:(UIStoryboardSegue *)segue {} From d695ccdc0f332b12ea8a233d6afd66f8d07cb2fd Mon Sep 17 00:00:00 2001 From: Seth Friedman Date: Tue, 18 Mar 2014 01:38:58 -0500 Subject: [PATCH 04/26] Clean up code --- Music City Center/MCCFloorViewController.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Music City Center/MCCFloorViewController.m b/Music City Center/MCCFloorViewController.m index c0723d4..8d6ed2b 100644 --- a/Music City Center/MCCFloorViewController.m +++ b/Music City Center/MCCFloorViewController.m @@ -116,13 +116,15 @@ - (void)viewDidLoad { self.mapView.mapID = self.mapIDs[self.currentFloor]; - self.mapView.region = MKCoordinateRegionMake(CLLocationCoordinate2DMake(36.1575, -86.777), MKCoordinateSpanMake(.004, .004)); + self.mapView.region = MKCoordinateRegionMake(CLLocationCoordinate2DMake(36.1575, -86.777), MKCoordinateSpanMake(.004, .004)); self.mapView.delegate = self; self.routing = NO; + // self.mapView.mapType = MKMapTypeHybrid + } - (void)didReceiveMemoryWarning @@ -244,8 +246,6 @@ -(void)drawPolylineFromStartLocation:(MCCFloorPlanLocation *)startLocation { } - - #pragma mark - IB Actions - (IBAction)endTapped:(UIBarButtonItem *)sender { From 96c96a31f244585858b6633bad0902b005fe63f9 Mon Sep 17 00:00:00 2001 From: Seth Friedman Date: Tue, 18 Mar 2014 02:01:33 -0500 Subject: [PATCH 05/26] Dynamically pull directions onto the map --- Music City Center/Base.lproj/Main.storyboard | 2 +- .../MCCDirectionsTableViewController.h | 2 + .../MCCDirectionsTableViewController.m | 15 ----- Music City Center/MCCFloorViewController.m | 56 ++++++++++++++++++- 4 files changed, 56 insertions(+), 19 deletions(-) diff --git a/Music City Center/Base.lproj/Main.storyboard b/Music City Center/Base.lproj/Main.storyboard index 6a693d2..9cb2fe9 100644 --- a/Music City Center/Base.lproj/Main.storyboard +++ b/Music City Center/Base.lproj/Main.storyboard @@ -143,7 +143,7 @@ - + diff --git a/Music City Center/MCCDirectionsTableViewController.h b/Music City Center/MCCDirectionsTableViewController.h index 486244b..107ca45 100644 --- a/Music City Center/MCCDirectionsTableViewController.h +++ b/Music City Center/MCCDirectionsTableViewController.h @@ -10,4 +10,6 @@ @interface MCCDirectionsTableViewController : UITableViewController +@property (nonatomic, copy) NSArray *directions; + @end diff --git a/Music City Center/MCCDirectionsTableViewController.m b/Music City Center/MCCDirectionsTableViewController.m index 637aab4..6da5296 100644 --- a/Music City Center/MCCDirectionsTableViewController.m +++ b/Music City Center/MCCDirectionsTableViewController.m @@ -10,25 +10,10 @@ @interface MCCDirectionsTableViewController () -@property (nonatomic, copy) NSArray *directions; - @end @implementation MCCDirectionsTableViewController -#pragma mark - Custom Getter - -- (NSArray *)directions { - if (!_directions) { - _directions = @[@"Walk left until you reach something.", - @"Keep going until you reach something else.", - @"Turn left and go up the stairs.", - @"Keep turning and walking."]; - } - - return _directions; -} - #pragma mark - View Controller Lifecycle - (void)viewDidLoad { diff --git a/Music City Center/MCCFloorViewController.m b/Music City Center/MCCFloorViewController.m index 8d6ed2b..212c9b4 100644 --- a/Music City Center/MCCFloorViewController.m +++ b/Music City Center/MCCFloorViewController.m @@ -19,6 +19,7 @@ #import "MCCFloorPlanImageMapping.h" #import "MCCFloorPlanLocation.h" #import +#import "MCCDirectionsTableViewController.h" static NSString * const floorPlanId = @"full-test-1"; @@ -32,6 +33,7 @@ @interface MCCFloorViewController () @property (strong, nonatomic) UIBarButtonItem *endButton; @property (nonatomic, getter = isRouting) BOOL routing; +@property (nonatomic, copy) NSArray *directions; @property (strong, nonatomic) NSString *currentFloor; @@ -196,8 +198,10 @@ -(void)drawPolylineFromStartLocation:(MCCFloorPlanLocation *)startLocation { // Start with the start of the first edge MCCFloorPlanEdge *firstEdge = [path.edges firstObject]; + NSLog(@"Starting at: %@",firstEdge.startLocation.locationId); NSLog(@"Ending at: %@", self.endLocation.locationId); + MCCFloorPlanImageLocation *firstLocation = [navData.mapping coordinatesOfLocation:firstEdge.startLocation.locationId]; MCCFloorPlanImageLocation *firstTranslatedLocation = @@ -207,8 +211,9 @@ -(void)drawPolylineFromStartLocation:(MCCFloorPlanLocation *)startLocation { // Turn the floorplan location into lat-long coords[0] = [self.floorPlanImage coordinateFromFloorPlanImageLocation:firstTranslatedLocation]; - - int i = 1; + + NSInteger i = 1; + NSMutableArray *directions = [NSMutableArray arrayWithCapacity:[path.edges count]]; // Then do the end of all the other edges for (MCCFloorPlanEdge *edge in path.edges) { @@ -223,10 +228,12 @@ -(void)drawPolylineFromStartLocation:(MCCFloorPlanLocation *)startLocation { MCCFloorPlanImageLocation *translatedLocation = [MCCFloorPlanImageLocation floorPlanImageLocationWithX:location.x - self.topLeft.x andY:location.y - self.topLeft.y]; - + // Turn the floorplan location into lat-long coords[i] = [self.floorPlanImage coordinateFromFloorPlanImageLocation:translatedLocation]; ++i; + + [directions addObject:[self directionForEdge:edge]]; } else { break; } @@ -240,10 +247,53 @@ -(void)drawPolylineFromStartLocation:(MCCFloorPlanLocation *)startLocation { [self.mapView addOverlay:self.polyline]; + self.directions = [directions copy]; self.routing = YES; }]; }]; +#pragma mark - Navigation + +- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { + if ([segue.identifier isEqualToString:@"PresentDirections"]) { + UINavigationController *navigationController = (UINavigationController *)segue.destinationViewController; + MCCDirectionsTableViewController *directionsTableViewController = (MCCDirectionsTableViewController *)navigationController.visibleViewController; + + directionsTableViewController.directions = self.directions; + } +} + +#pragma mark - Helper Method + +- (NSString *)directionForEdge:(MCCFloorPlanEdge *)edge { + NSString *direction; + + if (edge.angle < 180) { + direction = @"Turn left"; + } else if (edge.angle > 180) { + direction = @"Turn right"; + } else { + direction = @"Go straight"; + } + + return direction; +} + +#pragma mark - Map View Delegate + +- (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id)overlay { + MKOverlayRenderer *renderer; + + if ([overlay isKindOfClass:[MKPolyline class]]) { + MKPolyline *route = overlay; + MKPolylineRenderer *routeRenderer = [[MKPolylineRenderer alloc] initWithPolyline:route]; + routeRenderer.fillColor = [UIColor blueColor]; + routeRenderer.strokeColor = [UIColor blueColor]; + routeRenderer.lineWidth = 4; + renderer = routeRenderer; + } + + return renderer; } #pragma mark - IB Actions From a5eb597a295668a2f0bddcedcd71d860c3eda136 Mon Sep 17 00:00:00 2001 From: Seth Friedman Date: Tue, 18 Mar 2014 02:11:55 -0500 Subject: [PATCH 06/26] Add background color and text to current direction button --- Music City Center/Base.lproj/Main.storyboard | 8 ++++++-- Music City Center/MCCFloorViewController.m | 9 ++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Music City Center/Base.lproj/Main.storyboard b/Music City Center/Base.lproj/Main.storyboard index 9cb2fe9..ca5e1b3 100644 --- a/Music City Center/Base.lproj/Main.storyboard +++ b/Music City Center/Base.lproj/Main.storyboard @@ -136,9 +136,13 @@ -