From c1aad9d008b9508a3b852e68f205c0529c9ff299 Mon Sep 17 00:00:00 2001 From: Jerrad Thramer Date: Thu, 26 Sep 2019 18:05:27 -0600 Subject: [PATCH] Initial work, replacing enums and the like --- Directions Example/AppDelegate.h | 7 - Directions Example/AppDelegate.m | 14 - Directions Example/Info.plist | 4 +- Directions Example/ViewController.h | 5 - Directions Example/ViewController.m | 75 ----- Directions Example/main.m | 9 - MapboxDirections.xcodeproj/project.pbxproj | 306 ++++-------------- .../xcschemes/Example (Objective-C).xcscheme | 101 ------ ...mple (Swift).xcscheme => Example.xcscheme} | 34 +- Package.swift | 3 - README.md | 177 +--------- Sources/CMapboxDirections/MBRouteOptions.m | 11 - .../include/CMapboxDirections.h | 4 - .../CMapboxDirections/include/MBAttribute.h | 38 --- .../include/MBLaneIndication.h | 35 -- .../CMapboxDirections/include/MBRoadClasses.h | 40 --- .../include/MBRouteOptions.h | 58 ---- .../MapboxDirections/AttributeOptions.swift | 88 +++++ .../DirectionsProfileIdentifier.swift | 67 ++++ Sources/MapboxDirections/MBAttribute.swift | 50 --- .../MapboxDirections/MBLaneIndication.swift | 35 +- Sources/MapboxDirections/MBRoadClasses.swift | 60 ---- Sources/MapboxDirections/MapboxDirections.h | 4 - .../Match/MBMatchOptions.swift | 10 +- Sources/MapboxDirections/RoadClasses.swift | 105 ++++++ Tests/objc/BridgingTests.m | 83 ----- 26 files changed, 375 insertions(+), 1048 deletions(-) delete mode 100644 Directions Example/AppDelegate.h delete mode 100644 Directions Example/AppDelegate.m delete mode 100644 Directions Example/ViewController.h delete mode 100644 Directions Example/ViewController.m delete mode 100644 Directions Example/main.m delete mode 100644 MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme rename MapboxDirections.xcodeproj/xcshareddata/xcschemes/{Example (Swift).xcscheme => Example.xcscheme} (87%) delete mode 100644 Sources/CMapboxDirections/MBRouteOptions.m delete mode 100644 Sources/CMapboxDirections/include/CMapboxDirections.h delete mode 100644 Sources/CMapboxDirections/include/MBAttribute.h delete mode 100644 Sources/CMapboxDirections/include/MBLaneIndication.h delete mode 100644 Sources/CMapboxDirections/include/MBRoadClasses.h delete mode 100644 Sources/CMapboxDirections/include/MBRouteOptions.h create mode 100644 Sources/MapboxDirections/AttributeOptions.swift create mode 100644 Sources/MapboxDirections/DirectionsProfileIdentifier.swift delete mode 100644 Sources/MapboxDirections/MBAttribute.swift delete mode 100644 Sources/MapboxDirections/MBRoadClasses.swift create mode 100644 Sources/MapboxDirections/RoadClasses.swift delete mode 100644 Tests/objc/BridgingTests.m diff --git a/Directions Example/AppDelegate.h b/Directions Example/AppDelegate.h deleted file mode 100644 index adf30740d..000000000 --- a/Directions Example/AppDelegate.h +++ /dev/null @@ -1,7 +0,0 @@ -@import UIKit; - -@interface AppDelegate : UIResponder - -@property (strong, nonatomic) UIWindow *window; - -@end diff --git a/Directions Example/AppDelegate.m b/Directions Example/AppDelegate.m deleted file mode 100644 index bdb658af7..000000000 --- a/Directions Example/AppDelegate.m +++ /dev/null @@ -1,14 +0,0 @@ -#import "AppDelegate.h" -#import "ViewController.h" - -@implementation AppDelegate - -- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; - self.window.rootViewController = [[ViewController alloc] initWithNibName:nil bundle:nil]; - [self.window makeKeyAndVisible]; - - return YES; -} - -@end diff --git a/Directions Example/Info.plist b/Directions Example/Info.plist index 5c98453ab..ed09d0841 100644 --- a/Directions Example/Info.plist +++ b/Directions Example/Info.plist @@ -22,6 +22,8 @@ 44 LSRequiresIPhoneOS + NSLocationWhenInUseUsageDescription + Use the user location to fetch a route from their current position. UILaunchStoryboardName Launch Screen UIRequiredDeviceCapabilities @@ -41,7 +43,5 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight - NSLocationWhenInUseUsageDescription - Use the user location to fetch a route from their current position. diff --git a/Directions Example/ViewController.h b/Directions Example/ViewController.h deleted file mode 100644 index 29e7ff1c8..000000000 --- a/Directions Example/ViewController.h +++ /dev/null @@ -1,5 +0,0 @@ -@import UIKit; - -@interface ViewController : UIViewController - -@end diff --git a/Directions Example/ViewController.m b/Directions Example/ViewController.m deleted file mode 100644 index 9a6950fa4..000000000 --- a/Directions Example/ViewController.m +++ /dev/null @@ -1,75 +0,0 @@ -@import Mapbox; -@import MapboxDirections; - -#import "ViewController.h" - -@interface ViewController () - -@property (nonatomic) MGLMapView *mapView; - -@end - -@implementation ViewController - -- (void)viewDidLoad { - [super viewDidLoad]; - - self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds]; - self.mapView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; - [self.view addSubview:self.mapView]; -} - -- (void)viewDidAppear:(BOOL)animated { - [super viewDidAppear:animated]; - - NSArray *waypoints = @[ - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(38.9131752, -77.0324047) coordinateAccuracy:-1 name:@"Mapbox"], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(38.8977, -77.0365) coordinateAccuracy:-1 name:@"White House"], - ]; - MBRouteOptions *options = [[MBRouteOptions alloc] initWithWaypoints:waypoints profileIdentifier:nil]; - options.includesSteps = YES; - - [[MBDirections sharedDirections] calculateDirectionsWithOptions:options completionHandler:^(NSArray * _Nullable waypoints, NSArray * _Nullable routes, NSError * _Nullable error) { - if (error) { - NSLog(@"Error calculating directions: %@", error); - return; - } - - MBRoute *route = routes.firstObject; - MBRouteLeg *leg = route.legs.firstObject; - if (leg) { - NSLog(@"Route via %@:", leg); - - NSLengthFormatter *distanceFormatter = [[NSLengthFormatter alloc] init]; - NSString *formattedDistance = [distanceFormatter stringFromMeters:leg.distance]; - - NSDateComponentsFormatter *travelTimeFormatter = [[NSDateComponentsFormatter alloc] init]; - travelTimeFormatter.unitsStyle = NSDateComponentsFormatterUnitsStyleShort; - NSString *formattedTravelTime = [travelTimeFormatter stringFromTimeInterval:route.expectedTravelTime]; - - NSLog(@"Distance: %@; ETA: %@", formattedDistance, formattedTravelTime); - - for (MBRouteStep *step in leg.steps) { - NSLog(@"%@ [%@ %@]", step.instructions, MBStringFromManeuverType(step.maneuverType), MBStringFromManeuverDirection(step.maneuverDirection)); - NSString *formattedDistance = [distanceFormatter stringFromMeters:step.distance]; - NSLog(@"— %@ for %@ —", MBStringFromTransportType(step.transportType), formattedDistance); - } - - if (route.coordinateCount) { - // Convert the route’s coordinates into a polyline. - CLLocationCoordinate2D *routeCoordinates = malloc(route.coordinateCount * sizeof(CLLocationCoordinate2D)); - [route getCoordinates:routeCoordinates]; - MGLPolyline *routeLine = [MGLPolyline polylineWithCoordinates:routeCoordinates count:route.coordinateCount]; - - // Add the polyline to the map and fit the viewport to the polyline. - [self.mapView addAnnotation:routeLine]; - [self.mapView setVisibleCoordinates:routeCoordinates count:route.coordinateCount edgePadding:UIEdgeInsetsZero animated:YES]; - - // Make sure to free this array to avoid leaking memory. - free(routeCoordinates); - } - } - }]; -} - -@end diff --git a/Directions Example/main.m b/Directions Example/main.m deleted file mode 100644 index b86a93b1f..000000000 --- a/Directions Example/main.m +++ /dev/null @@ -1,9 +0,0 @@ -@import UIKit; - -#import "AppDelegate.h" - -int main(int argc, char * argv[]) { - @autoreleasepool { - return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); - } -} diff --git a/MapboxDirections.xcodeproj/project.pbxproj b/MapboxDirections.xcodeproj/project.pbxproj index fb0680dd9..3ef4a066d 100644 --- a/MapboxDirections.xcodeproj/project.pbxproj +++ b/MapboxDirections.xcodeproj/project.pbxproj @@ -7,37 +7,10 @@ objects = { /* Begin PBXBuildFile section */ - 3556CE9D22649CF3009397B5 /* BridgingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3556CE9C22649CF3009397B5 /* BridgingTests.m */; }; - 3556CE9E22649CF3009397B5 /* BridgingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3556CE9C22649CF3009397B5 /* BridgingTests.m */; }; - 3556CE9F22649CF3009397B5 /* BridgingTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 3556CE9C22649CF3009397B5 /* BridgingTests.m */; }; - 3563928722AAA0AB004A377E /* CMapboxDirections.h in Headers */ = {isa = PBXBuildFile; fileRef = 3563928622AAA0AB004A377E /* CMapboxDirections.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3563928822AAA0AB004A377E /* CMapboxDirections.h in Headers */ = {isa = PBXBuildFile; fileRef = 3563928622AAA0AB004A377E /* CMapboxDirections.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3563928922AAA0AB004A377E /* CMapboxDirections.h in Headers */ = {isa = PBXBuildFile; fileRef = 3563928622AAA0AB004A377E /* CMapboxDirections.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 3563928A22AAA0AB004A377E /* CMapboxDirections.h in Headers */ = {isa = PBXBuildFile; fileRef = 3563928622AAA0AB004A377E /* CMapboxDirections.h */; settings = {ATTRIBUTES = (Public, ); }; }; 35828C9E217A003F00ED546E /* OfflineDirections.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35828C9D217A003F00ED546E /* OfflineDirections.swift */; }; 35828C9F217A003F00ED546E /* OfflineDirections.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35828C9D217A003F00ED546E /* OfflineDirections.swift */; }; 35828CA0217A003F00ED546E /* OfflineDirections.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35828C9D217A003F00ED546E /* OfflineDirections.swift */; }; 35828CA1217A003F00ED546E /* OfflineDirections.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35828C9D217A003F00ED546E /* OfflineDirections.swift */; }; - 35C0D78F22563B2B005E05A5 /* MBRoadClasses.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78A22563B2A005E05A5 /* MBRoadClasses.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79022563B2B005E05A5 /* MBRoadClasses.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78A22563B2A005E05A5 /* MBRoadClasses.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79122563B2B005E05A5 /* MBRoadClasses.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78A22563B2A005E05A5 /* MBRoadClasses.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79222563B2B005E05A5 /* MBRoadClasses.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78A22563B2A005E05A5 /* MBRoadClasses.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79322563B2B005E05A5 /* MBRouteOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78B22563B2A005E05A5 /* MBRouteOptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79422563B2B005E05A5 /* MBRouteOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78B22563B2A005E05A5 /* MBRouteOptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79522563B2B005E05A5 /* MBRouteOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78B22563B2A005E05A5 /* MBRouteOptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79622563B2B005E05A5 /* MBRouteOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78B22563B2A005E05A5 /* MBRouteOptions.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79722563B2B005E05A5 /* MBLaneIndication.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78C22563B2B005E05A5 /* MBLaneIndication.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79822563B2B005E05A5 /* MBLaneIndication.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78C22563B2B005E05A5 /* MBLaneIndication.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79922563B2B005E05A5 /* MBLaneIndication.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78C22563B2B005E05A5 /* MBLaneIndication.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79A22563B2B005E05A5 /* MBLaneIndication.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78C22563B2B005E05A5 /* MBLaneIndication.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D79B22563B2B005E05A5 /* MBRouteOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C0D78D22563B2B005E05A5 /* MBRouteOptions.m */; }; - 35C0D79C22563B2B005E05A5 /* MBRouteOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C0D78D22563B2B005E05A5 /* MBRouteOptions.m */; }; - 35C0D79D22563B2B005E05A5 /* MBRouteOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C0D78D22563B2B005E05A5 /* MBRouteOptions.m */; }; - 35C0D79E22563B2B005E05A5 /* MBRouteOptions.m in Sources */ = {isa = PBXBuildFile; fileRef = 35C0D78D22563B2B005E05A5 /* MBRouteOptions.m */; }; - 35C0D79F22563B2B005E05A5 /* MBAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78E22563B2B005E05A5 /* MBAttribute.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D7A022563B2B005E05A5 /* MBAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78E22563B2B005E05A5 /* MBAttribute.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D7A122563B2B005E05A5 /* MBAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78E22563B2B005E05A5 /* MBAttribute.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 35C0D7A222563B2B005E05A5 /* MBAttribute.h in Headers */ = {isa = PBXBuildFile; fileRef = 35C0D78E22563B2B005E05A5 /* MBAttribute.h */; settings = {ATTRIBUTES = (Public, ); }; }; 35CC310B2285739700EA1966 /* WalkingOptionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35CC310A2285739700EA1966 /* WalkingOptionsTests.swift */; }; 35CC310C2285739700EA1966 /* WalkingOptionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35CC310A2285739700EA1966 /* WalkingOptionsTests.swift */; }; 35CC310D2285739700EA1966 /* WalkingOptionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35CC310A2285739700EA1966 /* WalkingOptionsTests.swift */; }; @@ -66,6 +39,10 @@ 35EFD00C207DFACA00BF3873 /* MBVisualInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35EFD00A207DFACA00BF3873 /* MBVisualInstruction.swift */; }; 35EFD00D207DFACA00BF3873 /* MBVisualInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35EFD00A207DFACA00BF3873 /* MBVisualInstruction.swift */; }; 35EFD00E207DFACA00BF3873 /* MBVisualInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 35EFD00A207DFACA00BF3873 /* MBVisualInstruction.swift */; }; + 438BFEC2233D854D00457294 /* DirectionsProfileIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 438BFEC1233D854D00457294 /* DirectionsProfileIdentifier.swift */; }; + 438BFEC3233D854D00457294 /* DirectionsProfileIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 438BFEC1233D854D00457294 /* DirectionsProfileIdentifier.swift */; }; + 438BFEC4233D854D00457294 /* DirectionsProfileIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 438BFEC1233D854D00457294 /* DirectionsProfileIdentifier.swift */; }; + 438BFEC5233D854D00457294 /* DirectionsProfileIdentifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 438BFEC1233D854D00457294 /* DirectionsProfileIdentifier.swift */; }; 8D381B611FD9F5B1008D5A58 /* noDestinationName.json in Resources */ = {isa = PBXBuildFile; fileRef = 8D381B601FD9F5B1008D5A58 /* noDestinationName.json */; }; 8D381B631FDB01D1008D5A58 /* apiDestinationName.json in Resources */ = {isa = PBXBuildFile; fileRef = 8D381B621FDB01D1008D5A58 /* apiDestinationName.json */; }; 8D381B641FDB0898008D5A58 /* noDestinationName.json in Resources */ = {isa = PBXBuildFile; fileRef = 8D381B601FD9F5B1008D5A58 /* noDestinationName.json */; }; @@ -94,7 +71,7 @@ AEDC212120B6125C0052DED8 /* MBComponentRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDC211C20B6104A0052DED8 /* MBComponentRepresentable.swift */; }; AEDC212220B6125D0052DED8 /* MBComponentRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDC211C20B6104A0052DED8 /* MBComponentRepresentable.swift */; }; AEDC212320B6125E0052DED8 /* MBComponentRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEDC211C20B6104A0052DED8 /* MBComponentRepresentable.swift */; }; - C51538CC1E807FF00093FF3E /* MBAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* MBAttribute.swift */; }; + C51538CC1E807FF00093FF3E /* AttributeOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* AttributeOptions.swift */; }; C5247D711E818A24004B6154 /* AnnotationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5247D701E818A24004B6154 /* AnnotationTests.swift */; }; C52552B91FA15D5900B1545C /* MBVisualInstructionBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52552B81FA15D5900B1545C /* MBVisualInstructionBanner.swift */; }; C52552BA1FA15D5E00B1545C /* MBVisualInstructionBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52552B81FA15D5900B1545C /* MBVisualInstructionBanner.swift */; }; @@ -108,9 +85,9 @@ C52CE3901F6AF63D0069963D /* MBSpokenInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = C55FB44A1F6AEBF6006BD1E9 /* MBSpokenInstruction.swift */; }; C52CE3911F6AF63E0069963D /* MBSpokenInstruction.swift in Sources */ = {isa = PBXBuildFile; fileRef = C55FB44A1F6AEBF6006BD1E9 /* MBSpokenInstruction.swift */; }; C52CE3931F6AF6E70069963D /* IntructionsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C52CE3921F6AF6E70069963D /* IntructionsTests.swift */; }; - C53A02261E92C26E009837BD /* MBAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* MBAttribute.swift */; }; - C53A02271E92C26F009837BD /* MBAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* MBAttribute.swift */; }; - C53A02281E92C271009837BD /* MBAttribute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* MBAttribute.swift */; }; + C53A02261E92C26E009837BD /* AttributeOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* AttributeOptions.swift */; }; + C53A02271E92C26F009837BD /* AttributeOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* AttributeOptions.swift */; }; + C53A02281E92C271009837BD /* AttributeOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C51538CB1E807FF00093FF3E /* AttributeOptions.swift */; }; C53A02291E92C27A009837BD /* AnnotationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5247D701E818A24004B6154 /* AnnotationTests.swift */; }; C53A022A1E92C27B009837BD /* AnnotationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5247D701E818A24004B6154 /* AnnotationTests.swift */; }; C53A022B1E92C281009837BD /* annotation.json in Resources */ = {isa = PBXBuildFile; fileRef = C5A3D3971E8188FE00D494A0 /* annotation.json */; }; @@ -134,9 +111,9 @@ C57D55051DB566A900B94B74 /* MBIntersection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C57D55001DB5669600B94B74 /* MBIntersection.swift */; }; C57D55081DB58C0200B94B74 /* MBLane.swift in Sources */ = {isa = PBXBuildFile; fileRef = C57D55071DB58C0200B94B74 /* MBLane.swift */; }; C582BA2E2073ED6300647DAA /* Array.swift in Sources */ = {isa = PBXBuildFile; fileRef = C582BA2D2073ED6300647DAA /* Array.swift */; }; - C584E3F71F201C7B00BBC9BB /* MBRoadClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59426061F1EA6C400C8E59C /* MBRoadClasses.swift */; }; - C584E3F81F201C7C00BBC9BB /* MBRoadClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59426061F1EA6C400C8E59C /* MBRoadClasses.swift */; }; - C584E3F91F201C7D00BBC9BB /* MBRoadClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59426061F1EA6C400C8E59C /* MBRoadClasses.swift */; }; + C584E3F71F201C7B00BBC9BB /* RoadClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59426061F1EA6C400C8E59C /* RoadClasses.swift */; }; + C584E3F81F201C7C00BBC9BB /* RoadClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59426061F1EA6C400C8E59C /* RoadClasses.swift */; }; + C584E3F91F201C7D00BBC9BB /* RoadClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59426061F1EA6C400C8E59C /* RoadClasses.swift */; }; C58EA7AA1E9D7EAD008F98CE /* MBCongestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = C58EA7A91E9D7EAD008F98CE /* MBCongestion.swift */; }; C58EA7AB1E9D7F73008F98CE /* MBCongestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = C58EA7A91E9D7EAD008F98CE /* MBCongestion.swift */; }; C58EA7AC1E9D7F74008F98CE /* MBCongestion.swift in Sources */ = {isa = PBXBuildFile; fileRef = C58EA7A91E9D7EAD008F98CE /* MBCongestion.swift */; }; @@ -144,7 +121,7 @@ C59094B5203B5C7F00EB2417 /* MBDrawingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59094B4203B5C7F00EB2417 /* MBDrawingView.swift */; }; C59094BF203B800300EB2417 /* MBDirectionsOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59094BE203B800300EB2417 /* MBDirectionsOptions.swift */; }; C59094C1203DE6BC00EB2417 /* MBDirectionsResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59094C0203DE6BC00EB2417 /* MBDirectionsResult.swift */; }; - C59426071F1EA6C400C8E59C /* MBRoadClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59426061F1EA6C400C8E59C /* MBRoadClasses.swift */; }; + C59426071F1EA6C400C8E59C /* RoadClasses.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59426061F1EA6C400C8E59C /* RoadClasses.swift */; }; C59666392048A20E00C45CE5 /* RoutableMatchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59666382048A20E00C45CE5 /* RoutableMatchTests.swift */; }; C596663A2048AECD00C45CE5 /* RoutableMatchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59666382048A20E00C45CE5 /* RoutableMatchTests.swift */; }; C596663B2048AECE00C45CE5 /* RoutableMatchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C59666382048A20E00C45CE5 /* RoutableMatchTests.swift */; }; @@ -249,12 +226,7 @@ DADD27BA1E5AAAD800D31FAD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DADD27B91E5AAAD800D31FAD /* ViewController.swift */; }; DADD27BF1E5AAAD800D31FAD /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DADD27BE1E5AAAD800D31FAD /* Assets.xcassets */; }; DADD27C81E5AAE3100D31FAD /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DADD27C71E5AAE3100D31FAD /* Launch Screen.storyboard */; }; - DADD27E71E5AB02C00D31FAD /* MapboxDirections.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA6C9D881CAE442B00094FBC /* MapboxDirections.framework */; }; - DADD27EE1E5AB0EB00D31FAD /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DADD27EA1E5AB0EB00D31FAD /* AppDelegate.m */; }; - DADD27EF1E5AB0EB00D31FAD /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DADD27EB1E5AB0EB00D31FAD /* main.m */; }; - DADD27F01E5AB0EB00D31FAD /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = DADD27ED1E5AB0EB00D31FAD /* ViewController.m */; }; DADD27F31E5ABD4300D31FAD /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DADD27F21E5ABD4300D31FAD /* Mapbox.framework */; }; - DADD27F41E5ABD6000D31FAD /* Mapbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DADD27F21E5ABD4300D31FAD /* Mapbox.framework */; }; DADD27F71E5AC8E900D31FAD /* MapboxDirections.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DA6C9D881CAE442B00094FBC /* MapboxDirections.framework */; }; DAE33A1B1F215DF600C06039 /* IntersectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAE33A1A1F215DF600C06039 /* IntersectionTests.swift */; }; DAE33A1C1F215DF600C06039 /* IntersectionTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DAE33A1A1F215DF600C06039 /* IntersectionTests.swift */; }; @@ -321,14 +293,7 @@ /* Begin PBXFileReference section */ 3556CE9922649CF2009397B5 /* MapboxDirectionsTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "MapboxDirectionsTests-Bridging-Header.h"; path = "../objc/MapboxDirectionsTests-Bridging-Header.h"; sourceTree = ""; }; - 3556CE9C22649CF3009397B5 /* BridgingTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = BridgingTests.m; path = ../objc/BridgingTests.m; sourceTree = ""; }; - 3563928622AAA0AB004A377E /* CMapboxDirections.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CMapboxDirections.h; path = include/CMapboxDirections.h; sourceTree = ""; }; 35828C9D217A003F00ED546E /* OfflineDirections.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OfflineDirections.swift; sourceTree = ""; }; - 35C0D78A22563B2A005E05A5 /* MBRoadClasses.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBRoadClasses.h; path = Sources/CMapboxDirections/include/MBRoadClasses.h; sourceTree = SOURCE_ROOT; }; - 35C0D78B22563B2A005E05A5 /* MBRouteOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBRouteOptions.h; path = Sources/CMapboxDirections/include/MBRouteOptions.h; sourceTree = SOURCE_ROOT; }; - 35C0D78C22563B2B005E05A5 /* MBLaneIndication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBLaneIndication.h; path = Sources/CMapboxDirections/include/MBLaneIndication.h; sourceTree = SOURCE_ROOT; }; - 35C0D78D22563B2B005E05A5 /* MBRouteOptions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MBRouteOptions.m; path = Sources/CMapboxDirections/MBRouteOptions.m; sourceTree = SOURCE_ROOT; }; - 35C0D78E22563B2B005E05A5 /* MBAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MBAttribute.h; path = Sources/CMapboxDirections/include/MBAttribute.h; sourceTree = SOURCE_ROOT; }; 35CC310A2285739700EA1966 /* WalkingOptionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WalkingOptionsTests.swift; sourceTree = ""; }; 35D92FEF218203AA000C78CB /* 2018-10-16-Liechtenstein.tar */ = {isa = PBXFileReference; lastKnownFileType = archive.tar; path = "2018-10-16-Liechtenstein.tar"; sourceTree = ""; }; 35DBF004217DF0D90009D2AE /* MBCoordinateBounds.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MBCoordinateBounds.swift; sourceTree = ""; }; @@ -337,6 +302,9 @@ 35DBF013217E199E0009D2AE /* OfflineDirectionsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OfflineDirectionsTests.swift; sourceTree = ""; }; 35DBF018217F38A30009D2AE /* versions.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = versions.json; sourceTree = ""; }; 35EFD00A207DFACA00BF3873 /* MBVisualInstruction.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MBVisualInstruction.swift; sourceTree = ""; }; + 438BFEBC233D7FA900457294 /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; + 438BFEC0233D805500457294 /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; + 438BFEC1233D854D00457294 /* DirectionsProfileIdentifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DirectionsProfileIdentifier.swift; sourceTree = ""; }; 8D381B601FD9F5B1008D5A58 /* noDestinationName.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = noDestinationName.json; sourceTree = ""; }; 8D381B621FDB01D1008D5A58 /* apiDestinationName.json */ = {isa = PBXFileReference; explicitFileType = text.json; path = apiDestinationName.json; sourceTree = ""; }; 8D381B691FDB101F008D5A58 /* String.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = String.swift; sourceTree = ""; }; @@ -345,7 +313,7 @@ AEAB391020D94699008F4E54 /* subVisualInstructions.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = subVisualInstructions.json; sourceTree = ""; }; AEDC211820B5DBDE0052DED8 /* MBLaneIndicationComponent.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MBLaneIndicationComponent.swift; sourceTree = ""; }; AEDC211C20B6104A0052DED8 /* MBComponentRepresentable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBComponentRepresentable.swift; sourceTree = ""; }; - C51538CB1E807FF00093FF3E /* MBAttribute.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBAttribute.swift; sourceTree = ""; }; + C51538CB1E807FF00093FF3E /* AttributeOptions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AttributeOptions.swift; sourceTree = ""; }; C5247D701E818A24004B6154 /* AnnotationTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AnnotationTests.swift; sourceTree = ""; }; C52552B81FA15D5900B1545C /* MBVisualInstructionBanner.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBVisualInstructionBanner.swift; sourceTree = ""; }; C52552BF1FA1628A00B1545C /* MBVisualInstructionComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBVisualInstructionComponent.swift; sourceTree = ""; }; @@ -361,10 +329,9 @@ C59094B4203B5C7F00EB2417 /* MBDrawingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MBDrawingView.swift; sourceTree = ""; }; C59094BE203B800300EB2417 /* MBDirectionsOptions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MBDirectionsOptions.swift; sourceTree = ""; }; C59094C0203DE6BC00EB2417 /* MBDirectionsResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MBDirectionsResult.swift; sourceTree = ""; }; - C59426061F1EA6C400C8E59C /* MBRoadClasses.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBRoadClasses.swift; sourceTree = ""; }; + C59426061F1EA6C400C8E59C /* RoadClasses.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoadClasses.swift; sourceTree = ""; }; C59666382048A20E00C45CE5 /* RoutableMatchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoutableMatchTests.swift; sourceTree = ""; }; C5A3D3971E8188FE00D494A0 /* annotation.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = annotation.json; path = v5/annotation.json; sourceTree = ""; }; - C5AD8657202E24F500BF47D5 /* 0E4ACB76-F60D-38A4-A651-CCFD819876A1.bcsymbolmap */ = {isa = PBXFileReference; lastKnownFileType = text; name = "0E4ACB76-F60D-38A4-A651-CCFD819876A1.bcsymbolmap"; path = "Carthage/Build/iOS/0E4ACB76-F60D-38A4-A651-CCFD819876A1.bcsymbolmap"; sourceTree = ""; }; C5AD8658202E24F500BF47D5 /* AWSPolly.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AWSPolly.framework; path = Carthage/Build/iOS/AWSPolly.framework; sourceTree = ""; }; C5AD8659202E24F500BF47D5 /* AWSCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AWSCore.framework; path = Carthage/Build/iOS/AWSCore.framework; sourceTree = ""; }; C5AD865A202E24F500BF47D5 /* Turf.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Turf.framework; path = Carthage/Build/iOS/Turf.framework; sourceTree = ""; }; @@ -405,18 +372,12 @@ DAC05F191CFC077C00FA0071 /* MBRouteLeg.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MBRouteLeg.swift; sourceTree = ""; }; DAC05F1B1CFC1E5300FA0071 /* v5_driving_dc_polyline.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = v5_driving_dc_polyline.json; sourceTree = ""; }; DACCFCA82225359500110FC9 /* v5_driving_oldenburg_polyline.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = v5_driving_oldenburg_polyline.json; sourceTree = ""; }; - DADD27B51E5AAAD800D31FAD /* Example (Swift).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example (Swift).app"; sourceTree = BUILT_PRODUCTS_DIR; }; + DADD27B51E5AAAD800D31FAD /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; DADD27B71E5AAAD800D31FAD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; DADD27B91E5AAAD800D31FAD /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; DADD27BE1E5AAAD800D31FAD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; DADD27C31E5AAAD800D31FAD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; DADD27C71E5AAE3100D31FAD /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = ""; }; - DADD27D01E5AAFFD00D31FAD /* Example (Objective-C).app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Example (Objective-C).app"; sourceTree = BUILT_PRODUCTS_DIR; }; - DADD27E91E5AB0EB00D31FAD /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; - DADD27EA1E5AB0EB00D31FAD /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; - DADD27EB1E5AB0EB00D31FAD /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; - DADD27EC1E5AB0EB00D31FAD /* ViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; - DADD27ED1E5AB0EB00D31FAD /* ViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; DADD27F21E5ABD4300D31FAD /* Mapbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Mapbox.framework; path = Carthage/Build/iOS/Mapbox.framework; sourceTree = ""; }; DAE33A1A1F215DF600C06039 /* IntersectionTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = IntersectionTests.swift; sourceTree = ""; }; DAE9E0F31EB7DE2E001E8E8B /* RouteOptionsTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RouteOptionsTests.swift; path = Tests/MapboxDirectionsTests/RouteOptionsTests.swift; sourceTree = SOURCE_ROOT; }; @@ -490,15 +451,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DADD27CD1E5AAFFD00D31FAD /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - DADD27E71E5AB02C00D31FAD /* MapboxDirections.framework in Frameworks */, - DADD27F41E5ABD6000D31FAD /* Mapbox.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; E05B24A0DFB05E8378736C51 /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; @@ -510,20 +462,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 35C0D78922563B1C005E05A5 /* CMapboxDirections */ = { - isa = PBXGroup; - children = ( - 3563928622AAA0AB004A377E /* CMapboxDirections.h */, - 35C0D78E22563B2B005E05A5 /* MBAttribute.h */, - 35C0D78C22563B2B005E05A5 /* MBLaneIndication.h */, - 35C0D78A22563B2A005E05A5 /* MBRoadClasses.h */, - 35C0D78B22563B2A005E05A5 /* MBRouteOptions.h */, - 35C0D78D22563B2B005E05A5 /* MBRouteOptions.m */, - ); - name = CMapboxDirections; - path = ../CMapboxDirections; - sourceTree = ""; - }; 35DBF017217F387F0009D2AE /* Offline */ = { isa = PBXGroup; children = ( @@ -543,6 +481,15 @@ name = "iOS Frameworks"; sourceTree = ""; }; + 438BFEBF233D804600457294 /* Documents */ = { + isa = PBXGroup; + children = ( + 438BFEBC233D7FA900457294 /* Package.swift */, + 438BFEC0233D805500457294 /* README.md */, + ); + name = Documents; + sourceTree = ""; + }; 8D381B5F1FD9F592008D5A58 /* Responses */ = { isa = PBXGroup; children = ( @@ -575,7 +522,6 @@ C5AD8656202E24F400BF47D5 /* Frameworks */ = { isa = PBXGroup; children = ( - C5AD8657202E24F500BF47D5 /* 0E4ACB76-F60D-38A4-A651-CCFD819876A1.bcsymbolmap */, C5AD8659202E24F500BF47D5 /* AWSCore.framework */, C5AD8658202E24F500BF47D5 /* AWSPolly.framework */, C5AD865D202E24F500BF47D5 /* MapboxCoreNavigation.framework */, @@ -619,7 +565,6 @@ DA6C9D891CAE442B00094FBC /* MapboxDirections */ = { isa = PBXGroup; children = ( - 35C0D78922563B1C005E05A5 /* CMapboxDirections */, 8D381B681FDB1009008D5A58 /* Extensions */, C5DAAC9E20191683001F9261 /* Match */, DA6C9D8A1CAE442B00094FBC /* MapboxDirections.h */, @@ -628,15 +573,16 @@ DAC05F171CFC075300FA0071 /* MBRoute.swift */, DAC05F191CFC077C00FA0071 /* MBRouteLeg.swift */, DA2E03EA1CB0E13D00D1269A /* MBRouteOptions.swift */, + 438BFEC1233D854D00457294 /* DirectionsProfileIdentifier.swift */, C59094BE203B800300EB2417 /* MBDirectionsOptions.swift */, DA2E03E81CB0E0B000D1269A /* MBRouteStep.swift */, C57D55001DB5669600B94B74 /* MBIntersection.swift */, C57D55071DB58C0200B94B74 /* MBLane.swift */, DAA76D671DD127CB0015EC78 /* MBLaneIndication.swift */, DAC05F151CFBFAC400FA0071 /* MBWaypoint.swift */, - C51538CB1E807FF00093FF3E /* MBAttribute.swift */, + C51538CB1E807FF00093FF3E /* AttributeOptions.swift */, C58EA7A91E9D7EAD008F98CE /* MBCongestion.swift */, - C59426061F1EA6C400C8E59C /* MBRoadClasses.swift */, + C59426061F1EA6C400C8E59C /* RoadClasses.swift */, DA6C9D8C1CAE442B00094FBC /* Info.plist */, C55FB44A1F6AEBF6006BD1E9 /* MBSpokenInstruction.swift */, C52552B81FA15D5900B1545C /* MBVisualInstructionBanner.swift */, @@ -671,7 +617,6 @@ DA688B3D21B89ECD00C9BB25 /* VisualInstructionComponentTests.swift */, DA6C9D9A1CAE442B00094FBC /* Info.plist */, DA6C9DAD1CAEC93800094FBC /* Fixtures */, - 3556CE9C22649CF3009397B5 /* BridgingTests.m */, 35CC310A2285739700EA1966 /* WalkingOptionsTests.swift */, 3556CE9922649CF2009397B5 /* MapboxDirectionsTests-Bridging-Header.h */, ); @@ -726,7 +671,6 @@ isa = PBXGroup; children = ( DADD27CA1E5AAF4D00D31FAD /* Swift */, - DADD27E81E5AB0DE00D31FAD /* Objective-C */, DADD27CB1E5AAF5600D31FAD /* Supporting Files */, ); path = "Directions Example"; @@ -748,25 +692,14 @@ DADD27BE1E5AAAD800D31FAD /* Assets.xcassets */, DADD27C71E5AAE3100D31FAD /* Launch Screen.storyboard */, DADD27C31E5AAAD800D31FAD /* Info.plist */, - DADD27EB1E5AB0EB00D31FAD /* main.m */, ); name = "Supporting Files"; sourceTree = ""; }; - DADD27E81E5AB0DE00D31FAD /* Objective-C */ = { - isa = PBXGroup; - children = ( - DADD27E91E5AB0EB00D31FAD /* AppDelegate.h */, - DADD27EA1E5AB0EB00D31FAD /* AppDelegate.m */, - DADD27EC1E5AB0EB00D31FAD /* ViewController.h */, - DADD27ED1E5AB0EB00D31FAD /* ViewController.m */, - ); - name = "Objective-C"; - sourceTree = ""; - }; DD6254451AE70C1700017857 = { isa = PBXGroup; children = ( + 438BFEBF233D804600457294 /* Documents */, DADD27B61E5AAAD800D31FAD /* Directions Example */, DA6C9D891CAE442B00094FBC /* MapboxDirections */, DA6C9D971CAE442B00094FBC /* MapboxDirectionsTests */, @@ -789,8 +722,7 @@ DA1A10D51D0101ED009F82FA /* MapboxDirections.framework */, DA1A10DE1D0101ED009F82FA /* MapboxDirectionsTests.xctest */, DA1A10FB1D010361009F82FA /* MapboxDirections.framework */, - DADD27B51E5AAAD800D31FAD /* Example (Swift).app */, - DADD27D01E5AAFFD00D31FAD /* Example (Objective-C).app */, + DADD27B51E5AAAD800D31FAD /* Example.app */, ); name = Products; sourceTree = ""; @@ -820,11 +752,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 35C0D79422563B2B005E05A5 /* MBRouteOptions.h in Headers */, - 35C0D79822563B2B005E05A5 /* MBLaneIndication.h in Headers */, - 35C0D79022563B2B005E05A5 /* MBRoadClasses.h in Headers */, - 3563928822AAA0AB004A377E /* CMapboxDirections.h in Headers */, - 35C0D7A022563B2B005E05A5 /* MBAttribute.h in Headers */, DA1A10C61D00F969009F82FA /* MapboxDirections.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -833,11 +760,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 35C0D79522563B2B005E05A5 /* MBRouteOptions.h in Headers */, - 35C0D79922563B2B005E05A5 /* MBLaneIndication.h in Headers */, - 35C0D79122563B2B005E05A5 /* MBRoadClasses.h in Headers */, - 3563928922AAA0AB004A377E /* CMapboxDirections.h in Headers */, - 35C0D7A122563B2B005E05A5 /* MBAttribute.h in Headers */, DA1A10EC1D010247009F82FA /* MapboxDirections.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -846,11 +768,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 35C0D79622563B2B005E05A5 /* MBRouteOptions.h in Headers */, - 35C0D79A22563B2B005E05A5 /* MBLaneIndication.h in Headers */, - 35C0D79222563B2B005E05A5 /* MBRoadClasses.h in Headers */, - 3563928A22AAA0AB004A377E /* CMapboxDirections.h in Headers */, - 35C0D7A222563B2B005E05A5 /* MBAttribute.h in Headers */, DA1A11031D0103A3009F82FA /* MapboxDirections.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -859,11 +776,6 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - 35C0D79322563B2B005E05A5 /* MBRouteOptions.h in Headers */, - 35C0D79722563B2B005E05A5 /* MBLaneIndication.h in Headers */, - 35C0D78F22563B2B005E05A5 /* MBRoadClasses.h in Headers */, - 3563928722AAA0AB004A377E /* CMapboxDirections.h in Headers */, - 35C0D79F22563B2B005E05A5 /* MBAttribute.h in Headers */, DA6C9D8B1CAE442B00094FBC /* MapboxDirections.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; @@ -997,9 +909,9 @@ productReference = DA6C9D911CAE442B00094FBC /* MapboxDirectionsTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; }; - DADD27B41E5AAAD800D31FAD /* Example (Swift) */ = { + DADD27B41E5AAAD800D31FAD /* Example */ = { isa = PBXNativeTarget; - buildConfigurationList = DADD27C61E5AAAD800D31FAD /* Build configuration list for PBXNativeTarget "Example (Swift)" */; + buildConfigurationList = DADD27C61E5AAAD800D31FAD /* Build configuration list for PBXNativeTarget "Example" */; buildPhases = ( DADD27B11E5AAAD800D31FAD /* Sources */, DADD27B21E5AAAD800D31FAD /* Frameworks */, @@ -1013,28 +925,9 @@ dependencies = ( DADD27FA1E5AC8E900D31FAD /* PBXTargetDependency */, ); - name = "Example (Swift)"; + name = Example; productName = "Directions Example"; - productReference = DADD27B51E5AAAD800D31FAD /* Example (Swift).app */; - productType = "com.apple.product-type.application"; - }; - DADD27CF1E5AAFFD00D31FAD /* Example (Objective-C) */ = { - isa = PBXNativeTarget; - buildConfigurationList = DADD27E41E5AAFFD00D31FAD /* Build configuration list for PBXNativeTarget "Example (Objective-C)" */; - buildPhases = ( - DADD27CC1E5AAFFD00D31FAD /* Sources */, - DADD27CD1E5AAFFD00D31FAD /* Frameworks */, - DADD27CE1E5AAFFD00D31FAD /* Resources */, - DADD27F61E5AC7FA00D31FAD /* Copy Frameworks */, - DA3DFB09236975E5003AE57F /* Apply Mapbox Access Token */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = "Example (Objective-C)"; - productName = "Directions Example Swift"; - productReference = DADD27D01E5AAFFD00D31FAD /* Example (Objective-C).app */; + productReference = DADD27B51E5AAAD800D31FAD /* Example.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ @@ -1081,10 +974,6 @@ LastSwiftMigration = 1100; ProvisioningStyle = Automatic; }; - DADD27CF1E5AAFFD00D31FAD = { - CreatedOnToolsVersion = 8.2.1; - ProvisioningStyle = Automatic; - }; }; }; buildConfigurationList = DD6254491AE70C1700017857 /* Build configuration list for PBXProject "MapboxDirections" */; @@ -1100,8 +989,7 @@ projectDirPath = ""; projectRoot = ""; targets = ( - DADD27B41E5AAAD800D31FAD /* Example (Swift) */, - DADD27CF1E5AAFFD00D31FAD /* Example (Objective-C) */, + DADD27B41E5AAAD800D31FAD /* Example */, DA6C9D871CAE442B00094FBC /* MapboxDirections */, DA6C9D901CAE442B00094FBC /* MapboxDirectionsTests */, DA1A10AE1D00F8FF009F82FA /* MapboxDirectionsMac */, @@ -1217,13 +1105,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DADD27CE1E5AAFFD00D31FAD /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -1281,22 +1162,6 @@ shellPath = /bin/sh; shellScript = "/usr/local/bin/carthage copy-frameworks"; }; - DADD27F61E5AC7FA00D31FAD /* Copy Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "$(SRCROOT)/Carthage/Build/iOS/Mapbox.framework", - "$(SRCROOT)/Carthage/Build/iOS/Polyline.framework", - ); - name = "Copy Frameworks"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/usr/local/bin/carthage copy-frameworks"; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -1308,14 +1173,14 @@ 35DBF010217E17A30009D2AE /* HTTPURLResponse.swift in Sources */, 8D43467A219E15C3008B7BF3 /* Double.swift in Sources */, C52552C61FA162F900B1545C /* MBVisualInstructionComponent.swift in Sources */, - C53A02261E92C26E009837BD /* MBAttribute.swift in Sources */, + C53A02261E92C26E009837BD /* AttributeOptions.swift in Sources */, DA1A10C91D00F969009F82FA /* MBRouteLeg.swift in Sources */, C52552BA1FA15D5E00B1545C /* MBVisualInstructionBanner.swift in Sources */, 35828C9F217A003F00ED546E /* OfflineDirections.swift in Sources */, C5DAAC9F20195AAE001F9261 /* MBTracepoint.swift in Sources */, C5990B4A2045E72800D7DFD4 /* MBDirectionsResult.swift in Sources */, 35EFD00C207DFACA00BF3873 /* MBVisualInstruction.swift in Sources */, - C584E3F71F201C7B00BBC9BB /* MBRoadClasses.swift in Sources */, + C584E3F71F201C7B00BBC9BB /* RoadClasses.swift in Sources */, C5DAACA220195AB2001F9261 /* MBMatchOptions.swift in Sources */, DA1A10CC1D00F969009F82FA /* MBWaypoint.swift in Sources */, 35DBF006217DF0D90009D2AE /* MBCoordinateBounds.swift in Sources */, @@ -1325,13 +1190,13 @@ DAA76D691DD127CB0015EC78 /* MBLaneIndication.swift in Sources */, AEDC211E20B612530052DED8 /* MBLaneIndicationComponent.swift in Sources */, DA1A10CB1D00F969009F82FA /* MBRouteStep.swift in Sources */, - 35C0D79C22563B2B005E05A5 /* MBRouteOptions.m in Sources */, C57D55031DB566A700B94B74 /* MBIntersection.swift in Sources */, C52CE38F1F6AF63C0069963D /* MBSpokenInstruction.swift in Sources */, C58EA7AB1E9D7F73008F98CE /* MBCongestion.swift in Sources */, 35DBF00B217E172C0009D2AE /* CLLocationCoordinate2D.swift in Sources */, 8D381B6B1FDB3D8A008D5A58 /* String.swift in Sources */, C56516851FE1AB8F00A0AD18 /* MBVisualInstructionType.swift in Sources */, + 438BFEC3233D854D00457294 /* DirectionsProfileIdentifier.swift in Sources */, C54549FC2073F1EF002E273F /* Array.swift in Sources */, C547EC691DB59F8F009817F3 /* MBLane.swift in Sources */, AEDC212120B6125C0052DED8 /* MBComponentRepresentable.swift in Sources */, @@ -1353,7 +1218,6 @@ DAE33A1C1F215DF600C06039 /* IntersectionTests.swift in Sources */, C5DAACB0201AA92B001F9261 /* MatchTests.swift in Sources */, DA1A10CE1D00F972009F82FA /* Fixture.swift in Sources */, - 3556CE9E22649CF3009397B5 /* BridgingTests.m in Sources */, DA1A110C1D01045E009F82FA /* DirectionsTests.swift in Sources */, C5D1D7F31F6AFBD600A1C4F1 /* IntructionsTests.swift in Sources */, DA4F84EE21C08BFB008A0434 /* WaypointTests.swift in Sources */, @@ -1370,14 +1234,14 @@ 35DBF011217E17A30009D2AE /* HTTPURLResponse.swift in Sources */, 8D43467B219E15C4008B7BF3 /* Double.swift in Sources */, C52552C71FA162FA00B1545C /* MBVisualInstructionComponent.swift in Sources */, - C53A02271E92C26F009837BD /* MBAttribute.swift in Sources */, + C53A02271E92C26F009837BD /* AttributeOptions.swift in Sources */, DA1A10EF1D010247009F82FA /* MBRouteLeg.swift in Sources */, C52552BB1FA15D5F00B1545C /* MBVisualInstructionBanner.swift in Sources */, 35828CA0217A003F00ED546E /* OfflineDirections.swift in Sources */, C5DAACA020195AAF001F9261 /* MBTracepoint.swift in Sources */, C5990B4B2045E72900D7DFD4 /* MBDirectionsResult.swift in Sources */, 35EFD00D207DFACA00BF3873 /* MBVisualInstruction.swift in Sources */, - C584E3F81F201C7C00BBC9BB /* MBRoadClasses.swift in Sources */, + C584E3F81F201C7C00BBC9BB /* RoadClasses.swift in Sources */, C5DAACA320195AB2001F9261 /* MBMatchOptions.swift in Sources */, DA1A10F21D010247009F82FA /* MBWaypoint.swift in Sources */, 35DBF007217DF0D90009D2AE /* MBCoordinateBounds.swift in Sources */, @@ -1387,13 +1251,13 @@ DAA76D6A1DD127CB0015EC78 /* MBLaneIndication.swift in Sources */, AEDC211F20B612540052DED8 /* MBLaneIndicationComponent.swift in Sources */, DA1A10F11D010247009F82FA /* MBRouteStep.swift in Sources */, - 35C0D79D22563B2B005E05A5 /* MBRouteOptions.m in Sources */, C57D55041DB566A800B94B74 /* MBIntersection.swift in Sources */, C52CE3901F6AF63D0069963D /* MBSpokenInstruction.swift in Sources */, C58EA7AC1E9D7F74008F98CE /* MBCongestion.swift in Sources */, 35DBF00C217E172C0009D2AE /* CLLocationCoordinate2D.swift in Sources */, 8D381B6C1FDB3D8B008D5A58 /* String.swift in Sources */, C56516861FE1AB9000A0AD18 /* MBVisualInstructionType.swift in Sources */, + 438BFEC4233D854D00457294 /* DirectionsProfileIdentifier.swift in Sources */, C54549FD2073F1F0002E273F /* Array.swift in Sources */, C547EC6A1DB59F90009817F3 /* MBLane.swift in Sources */, AEDC212220B6125D0052DED8 /* MBComponentRepresentable.swift in Sources */, @@ -1415,7 +1279,6 @@ DAE33A1D1F215DF600C06039 /* IntersectionTests.swift in Sources */, C5DAACB1201AA92B001F9261 /* MatchTests.swift in Sources */, DA1A10F51D010251009F82FA /* Fixture.swift in Sources */, - 3556CE9F22649CF3009397B5 /* BridgingTests.m in Sources */, DA1A110D1D01045E009F82FA /* DirectionsTests.swift in Sources */, C5D1D7F41F6AFBD600A1C4F1 /* IntructionsTests.swift in Sources */, DA4F84EF21C08BFB008A0434 /* WaypointTests.swift in Sources */, @@ -1432,14 +1295,14 @@ 35DBF012217E17A30009D2AE /* HTTPURLResponse.swift in Sources */, 8D43467C219E15C6008B7BF3 /* Double.swift in Sources */, C52552C81FA162FB00B1545C /* MBVisualInstructionComponent.swift in Sources */, - C53A02281E92C271009837BD /* MBAttribute.swift in Sources */, + C53A02281E92C271009837BD /* AttributeOptions.swift in Sources */, DA1A11061D0103A3009F82FA /* MBRouteLeg.swift in Sources */, C52552BC1FA15D6000B1545C /* MBVisualInstructionBanner.swift in Sources */, 35828CA1217A003F00ED546E /* OfflineDirections.swift in Sources */, C5DAACA120195AAF001F9261 /* MBTracepoint.swift in Sources */, C5990B4C2045E72A00D7DFD4 /* MBDirectionsResult.swift in Sources */, 35EFD00E207DFACA00BF3873 /* MBVisualInstruction.swift in Sources */, - C584E3F91F201C7D00BBC9BB /* MBRoadClasses.swift in Sources */, + C584E3F91F201C7D00BBC9BB /* RoadClasses.swift in Sources */, C5DAACA420195AB3001F9261 /* MBMatchOptions.swift in Sources */, DA1A11091D0103A3009F82FA /* MBWaypoint.swift in Sources */, 35DBF008217DF0D90009D2AE /* MBCoordinateBounds.swift in Sources */, @@ -1449,13 +1312,13 @@ DAA76D6B1DD127CB0015EC78 /* MBLaneIndication.swift in Sources */, AEDC212020B612560052DED8 /* MBLaneIndicationComponent.swift in Sources */, DA1A11081D0103A3009F82FA /* MBRouteStep.swift in Sources */, - 35C0D79E22563B2B005E05A5 /* MBRouteOptions.m in Sources */, C57D55051DB566A900B94B74 /* MBIntersection.swift in Sources */, C52CE3911F6AF63E0069963D /* MBSpokenInstruction.swift in Sources */, C58EA7AD1E9D7F75008F98CE /* MBCongestion.swift in Sources */, 35DBF00D217E172C0009D2AE /* CLLocationCoordinate2D.swift in Sources */, 8D381B6D1FDB3D8B008D5A58 /* String.swift in Sources */, C56516871FE1AB9100A0AD18 /* MBVisualInstructionType.swift in Sources */, + 438BFEC5233D854D00457294 /* DirectionsProfileIdentifier.swift in Sources */, C54549FE2073F1F1002E273F /* Array.swift in Sources */, C547EC6B1DB59F91009817F3 /* MBLane.swift in Sources */, AEDC212320B6125E0052DED8 /* MBComponentRepresentable.swift in Sources */, @@ -1467,7 +1330,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C51538CC1E807FF00093FF3E /* MBAttribute.swift in Sources */, + C51538CC1E807FF00093FF3E /* AttributeOptions.swift in Sources */, 35DBF00F217E17A30009D2AE /* HTTPURLResponse.swift in Sources */, 8D434679219E1167008B7BF3 /* Double.swift in Sources */, DA2E03EB1CB0E13D00D1269A /* MBRouteOptions.swift in Sources */, @@ -1475,7 +1338,7 @@ C52552B91FA15D5900B1545C /* MBVisualInstructionBanner.swift in Sources */, C52552C01FA1628A00B1545C /* MBVisualInstructionComponent.swift in Sources */, 35828C9E217A003F00ED546E /* OfflineDirections.swift in Sources */, - C59426071F1EA6C400C8E59C /* MBRoadClasses.swift in Sources */, + C59426071F1EA6C400C8E59C /* RoadClasses.swift in Sources */, 35EFD00B207DFACA00BF3873 /* MBVisualInstruction.swift in Sources */, DAC05F161CFBFAC400FA0071 /* MBWaypoint.swift in Sources */, C57D55081DB58C0200B94B74 /* MBLane.swift in Sources */, @@ -1488,13 +1351,13 @@ DAC05F1A1CFC077C00FA0071 /* MBRouteLeg.swift in Sources */, AEDC211920B5DBDE0052DED8 /* MBLaneIndicationComponent.swift in Sources */, C5434B8A200693D00069E887 /* MBTracepoint.swift in Sources */, - 35C0D79B22563B2B005E05A5 /* MBRouteOptions.m in Sources */, DA6C9DA61CAE462800094FBC /* MBDirections.swift in Sources */, C55FB44B1F6AEBF6006BD1E9 /* MBSpokenInstruction.swift in Sources */, C5DAAC9A20191675001F9261 /* MBMatch.swift in Sources */, 35DBF00A217E172C0009D2AE /* CLLocationCoordinate2D.swift in Sources */, C58EA7AA1E9D7EAD008F98CE /* MBCongestion.swift in Sources */, 8D381B6A1FDB101F008D5A58 /* String.swift in Sources */, + 438BFEC2233D854D00457294 /* DirectionsProfileIdentifier.swift in Sources */, C56516841FE1A2DD00A0AD18 /* MBVisualInstructionType.swift in Sources */, C57D55011DB5669600B94B74 /* MBIntersection.swift in Sources */, AEDC211D20B6104B0052DED8 /* MBComponentRepresentable.swift in Sources */, @@ -1516,7 +1379,6 @@ DAE33A1B1F215DF600C06039 /* IntersectionTests.swift in Sources */, C5DAACAF201AA92B001F9261 /* MatchTests.swift in Sources */, DA6C9DB21CAECA0E00094FBC /* Fixture.swift in Sources */, - 3556CE9D22649CF3009397B5 /* BridgingTests.m in Sources */, DA1A110B1D01045E009F82FA /* DirectionsTests.swift in Sources */, C52CE3931F6AF6E70069963D /* IntructionsTests.swift in Sources */, DA4F84ED21C08BFB008A0434 /* WaypointTests.swift in Sources */, @@ -1535,16 +1397,6 @@ ); runOnlyForDeploymentPostprocessing = 0; }; - DADD27CC1E5AAFFD00D31FAD /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - DADD27F01E5AB0EB00D31FAD /* ViewController.m in Sources */, - DADD27EF1E5AB0EB00D31FAD /* main.m in Sources */, - DADD27EE1E5AB0EB00D31FAD /* AppDelegate.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -1934,9 +1786,9 @@ ); INFOPLIST_FILE = "Directions Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Directions.Swift; + PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Directions; PRODUCT_MODULE_NAME = DirectionsExampleSwift; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = Example; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_SWIFT3_OBJC_INFERENCE = Off; }; @@ -1956,54 +1808,13 @@ ); INFOPLIST_FILE = "Directions Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Directions.Swift; + PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Directions; PRODUCT_MODULE_NAME = DirectionsExampleSwift; - PRODUCT_NAME = "$(TARGET_NAME)"; + PRODUCT_NAME = Example; SWIFT_SWIFT3_OBJC_INFERENCE = Off; }; name = Release; }; - DADD27E51E5AAFFD00D31FAD /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = "Directions Example/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Directions.ObjectiveC; - PRODUCT_MODULE_NAME = DirectionsExampleObjectiveC; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - DADD27E61E5AAFFD00D31FAD /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ANALYZER_NONNULL = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - DEVELOPMENT_TEAM = ""; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)/Carthage/Build/iOS", - ); - INFOPLIST_FILE = "Directions Example/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.Directions.ObjectiveC; - PRODUCT_MODULE_NAME = DirectionsExampleObjectiveC; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; DD62546B1AE70C1700017857 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -2185,7 +1996,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - DADD27C61E5AAAD800D31FAD /* Build configuration list for PBXNativeTarget "Example (Swift)" */ = { + DADD27C61E5AAAD800D31FAD /* Build configuration list for PBXNativeTarget "Example" */ = { isa = XCConfigurationList; buildConfigurations = ( DADD27C41E5AAAD800D31FAD /* Debug */, @@ -2194,15 +2005,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - DADD27E41E5AAFFD00D31FAD /* Build configuration list for PBXNativeTarget "Example (Objective-C)" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - DADD27E51E5AAFFD00D31FAD /* Debug */, - DADD27E61E5AAFFD00D31FAD /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; DD6254491AE70C1700017857 /* Build configuration list for PBXProject "MapboxDirections" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme b/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme deleted file mode 100644 index f525f3e02..000000000 --- a/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Objective-C).xcscheme +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Swift).xcscheme b/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example.xcscheme similarity index 87% rename from MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Swift).xcscheme rename to MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example.xcscheme index b4114acd8..cbf1867a5 100644 --- a/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example (Swift).xcscheme +++ b/MapboxDirections.xcodeproj/xcshareddata/xcschemes/Example.xcscheme @@ -15,8 +15,8 @@ @@ -27,6 +27,15 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" shouldUseLaunchSchemeArgsEnv = "YES"> + + + + @@ -39,17 +48,6 @@ - - - - - - - - diff --git a/Package.swift b/Package.swift index f7b809a1f..ab4778171 100644 --- a/Package.swift +++ b/Package.swift @@ -22,9 +22,6 @@ let package = Package( .target( name: "MapboxDirections", dependencies: ["CMapboxDirections", "Polyline"]), - .target( - name: "CMapboxDirections" - ), .testTarget( name: "MapboxDirectionsTests", dependencies: ["MapboxDirections"]), diff --git a/README.md b/README.md index 208fe99b7..71b2548d7 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,6 @@ MapboxDirections.swift makes it easy to connect your iOS, macOS, tvOS, or watchOS application to the [Mapbox Directions](https://docs.mapbox.com/api/navigation/) and [Map Matching](https://docs.mapbox.com/api/navigation/#map-matching) APIs. Quickly get driving, cycling, or walking directions, whether the trip is nonstop or it has multiple stopping points, all using a simple interface reminiscent of MapKit’s `MKDirections` API. Fit a GPX trace to the [OpenStreetMap](https://www.openstreetmap.org/) road network. The Mapbox Directions and Map Matching APIs are powered by the [OSRM](http://project-osrm.org/) routing engine. For more information, see the [Mapbox Navigation](https://www.mapbox.com/navigation/) homepage. -Despite its name, MapboxDirections.swift works in Objective-C and Cocoa-AppleScript code in addition to Swift. - MapboxDirections.swift pairs well with [MapboxGeocoder.swift](https://github.com/mapbox/MapboxGeocoder.swift), [MapboxStatic.swift](https://github.com/mapbox/MapboxStatic.swift), the [Mapbox Navigation SDK for iOS](https://github.com/mapbox/mapbox-navigation-ios/), and the [Mapbox Maps SDK for iOS](https://docs.mapbox.com/ios/maps/) or [macOS SDK](https://mapbox.github.io/mapbox-gl-native/macos/). ## Getting started @@ -35,7 +33,7 @@ Then `import MapboxDirections` or `@import MapboxDirections;`. This library supports a minimum deployment target of iOS 10.0 or above, macOS 10.12.0 or above, tvOS 10.0 or above, or watchOS 2.0 or above. v0.30.0 is the last release of MapboxDirections.swift that supports a minimum deployment target of iOS 9._x_, macOS 10.11._x_, tvOS 9._x_, or watchOS 2._x_. -This repository contains example applications written in Swift and Objective-C that demonstrate how to use the framework. To run them, you need to use [Carthage](https://github.com/Carthage/Carthage) 0.19 or above to install the dependencies. Detailed documentation is available in the [Mapbox API Documentation](https://docs.mapbox.com/api/navigation/#directions). +This repository contains an example application that demonstrates how to use the framework. To run it, you need to use [Carthage](https://github.com/Carthage/Carthage) 0.19 or above to install the dependencies. Detailed documentation is available in the [Mapbox API Documentation](https://docs.mapbox.com/api/navigation/#directions). ## Usage @@ -43,11 +41,11 @@ This repository contains example applications written in Swift and Objective-C t You’ll need a [Mapbox access token](https://docs.mapbox.com/api/#access-tokens-and-token-scopes) in order to use the API. If you’re already using the [Mapbox Maps SDK for iOS](https://docs.mapbox.com/ios/maps/) or [macOS SDK](https://mapbox.github.io/mapbox-gl-native/macos/), MapboxDirections.swift automatically recognizes your access token, as long as you’ve placed it in the `MGLMapboxAccessToken` key of your application’s Info.plist file. -The examples below are each provided in Swift (denoted with `main.swift`), Objective-C (`main.m`), and AppleScript (`AppDelegate.applescript`). For further details, see the [MapboxDirections.swift API reference](https://docs.mapbox.com/ios/api/directions/). +The examples below are each provided in Swift (denoted with `main.swift`), For further details, see the [MapboxDirections.swift API reference](https://docs.mapbox.com/ios/api/directions/). ### Calculating directions between locations -The main directions class is Directions (in Swift) or MBDirections (in Objective-C or AppleScript). Create a directions object using your access token: +The main directions class is `Directions`. Create a directions object using your access token: ```swift // main.swift @@ -56,19 +54,6 @@ import MapboxDirections let directions = Directions(accessToken: "<#your access token#>") ``` -```objc -// main.m -@import MapboxDirections; - -MBDirections *directions = [[MBDirections alloc] initWithAccessToken:@"<#your access token#>"]; -``` - -```applescript --- AppDelegate.applescript -set theDirections to alloc of MBDirections of the current application -tell theDirections to initWithAccessToken:"<#your access token#>" -``` - Alternatively, you can place your access token in the `MGLMapboxAccessToken` key of your application’s Info.plist file, then use the shared directions object: ```swift @@ -76,17 +61,7 @@ Alternatively, you can place your access token in the `MGLMapboxAccessToken` key let directions = Directions.shared ``` -```objc -// main.m -MBDirections *directions = [MBDirections sharedDirections]; -``` - -```applescript --- AppDelegate.applescript -set theDirections to sharedDirections of MBDirections of the current application -``` - -With the directions object in hand, construct a RouteOptions or MBRouteOptions object and pass it into the `Directions.calculate(_:completionHandler:)` method. +With the directions object in hand, construct a RouteOptions object and pass it into the `Directions.calculate(_:completionHandler:)` method. ```swift // main.swift @@ -125,86 +100,7 @@ let task = directions.calculate(options) { (waypoints, routes, error) in } ``` -```objc -// main.m - -NSArray *waypoints = @[ - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(38.9131752, -77.0324047) coordinateAccuracy:-1 name:@"Mapbox"], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(38.8977, -77.0365) coordinateAccuracy:-1 name:@"White House"], -]; -MBRouteOptions *options = [[MBRouteOptions alloc] initWithWaypoints:waypoints - profileIdentifier:MBDirectionsProfileIdentifierAutomobileAvoidingTraffic]; -options.includesSteps = YES; - -NSURLSessionDataTask *task = [directions calculateDirectionsWithOptions:options - completionHandler:^(NSArray * _Nullable waypoints, - NSArray * _Nullable routes, - NSError * _Nullable error) { - if (error) { - NSLog(@"Error calculating directions: %@", error); - return; - } - - MBRoute *route = routes.firstObject; - MBRouteLeg *leg = route.legs.firstObject; - if (leg) { - NSLog(@"Route via %@:", leg); - - NSLengthFormatter *distanceFormatter = [[NSLengthFormatter alloc] init]; - NSString *formattedDistance = [distanceFormatter stringFromMeters:leg.distance]; - - NSDateComponentsFormatter *travelTimeFormatter = [[NSDateComponentsFormatter alloc] init]; - travelTimeFormatter.unitsStyle = NSDateComponentsFormatterUnitsStyleShort; - NSString *formattedTravelTime = [travelTimeFormatter stringFromTimeInterval:route.expectedTravelTime]; - - NSLog(@"Distance: %@; ETA: %@", formattedDistance, formattedTravelTime); - - for (MBRouteStep *step in leg.steps) { - NSLog(@"%@", step.instructions); - NSString *formattedDistance = [distanceFormatter stringFromMeters:step.distance]; - NSLog(@"— %@ —", formattedDistance); - } - } -}]; -``` - -```applescript --- AppDelegate.applescript - -set mapbox to alloc of MBWaypoint of the current application -tell mapbox to initWithCoordinate:{38.9131752, -77.0324047} coordinateAccuracy:-1 |name|:"Mapbox" -set theWhiteHouse to alloc of MBWaypoint of the current application -tell theWhiteHouse to initWithCoordinate:{38.8977, -77.0365} coordinateAccuracy:-1 |name|:"White House" -set theWaypoints to {mapbox, theWhiteHouse} - -set theOptions to alloc of MBRouteOptions of the current application -tell theOptions to initWithWaypoints:theWaypoints profileIdentifier:"mapbox/driving-traffic" -set theOptions's includesSteps to true - -set theURL to theDirections's URLForCalculatingDirectionsWithOptions:theOptions -set theData to the current application's NSData's dataWithContentsOfURL:theURL -set theJSON to the current application's NSJSONSerialization's JSONObjectWithData:theData options:0 |error|:(missing value) - -set theRoute to alloc of MBRoute of the current application -tell theRoute to initWithJson:(the first item of theJSON's routes) waypoints:theWaypoints profileIdentifier:"mapbox/driving" -set theLeg to the first item of theRoute's legs - -log "Route via " & theLeg's |name| & ":" - -set theDistanceFormatter to alloc of NSLengthFormatter of the current application -tell theDistanceFormatter to init() -set theDistance to theDistanceFormatter's stringFromMeters:(theLeg's distance) - -log "Distance: " & theDistance - -repeat with theStep in theLeg's steps - log theStep's instructions - set theDistance to theDistanceFormatter's stringFromMeters:(theStep's distance) - log "— " & theDistance & " —" -end repeat -``` - -This library uses version 5 of the Mapbox Directions API by default. To use version 4 instead, replace RouteOptions with RouteOptionsV4 (or MBRouteOptions with MBRouteOptionsV4). +This library uses version 5 of the Mapbox Directions API by default. To use version 4 instead, replace RouteOptions with RouteOptionsV4. ### Matching a trace to the road network @@ -253,55 +149,14 @@ let task = directions.calculate(options) { (matches, error) in } ``` -```objc -// main.m -NSArray *waypoints = @[ - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(32.712041, -117.172836) coordinateAccuracy:-1 name:nil], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(32.712256, -117.17291) coordinateAccuracy:-1 name:nil], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(32.712444, -117.17292) coordinateAccuracy:-1 name:nil], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(32.71257, -117.172922) coordinateAccuracy:-1 name:nil], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(32.7126, -117.172985) coordinateAccuracy:-1 name:nil], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(32.712597, -117.173143) coordinateAccuracy:-1 name:nil], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(32.712546, -117.173345) coordinateAccuracy:-1 name:nil], -]; - -MBMatchOptions *matchOptions = [[MBMatchOptions alloc] initWithWaypoints:waypoints profileIdentifier:MBDirectionsProfileIdentifierAutomobile]; -NSURLSessionDataTask *task = [[[MBDirections alloc] initWithAccessToken:MapboxAccessToken] calculateMatchesWithOptions:matchOptions completionHandler:^(NSArray * _Nullable matches, NSError * _Nullable error) { - if (error) { - NSLog(@"Error matching waypoints: %@", error); - return; - } - - MBMatch *match = matches.firstObject; - MBRouteLeg *leg = match.legs.firstObject; - if (leg) { - NSLog(@"Match via %@:", leg); - - NSLengthFormatter *distanceFormatter = [[NSLengthFormatter alloc] init]; - NSString *formattedDistance = [distanceFormatter stringFromMeters:leg.distance]; - NSDateComponentsFormatter *travelTimeFormatter = [[NSDateComponentsFormatter alloc] init]; - travelTimeFormatter.unitsStyle = NSDateComponentsFormatterUnitsStyleShort; - NSString *formattedTravelTime = [travelTimeFormatter stringFromTimeInterval:match.expectedTravelTime]; - - NSLog(@"Distance: %@; ETA: %@", formattedDistance, formattedTravelTime); - - for (MBRouteStep *step in leg.steps) { - NSLog(@"%@", step.instructions); - NSString *formattedDistance = [distanceFormatter stringFromMeters:step.distance]; - NSLog(@"— %@ —", formattedDistance); - } - } -}]; -``` - -You can also use the `Directions.calculateRoutes(matching:completionHandler:)` method in Swift or the `-[MBDirections calculateRoutesMatchingOptions:completionHandler:]` method in Objective-C to get Route objects suitable for use anywhere a standard Directions API response would be used. +You can also use the `Directions.calculateRoutes(matching:completionHandler:)` method to get Route objects suitable for use anywhere a standard Directions API response would be used. ## Usage with other Mapbox libraries ### Drawing the route on a map -With the [Mapbox Maps SDK for iOS](https://docs.mapbox.com/ios/maps/) or [macOS SDK](https://mapbox.github.io/mapbox-gl-native/macos/), you can easily draw the route on a map in Swift or Objective-C: +With the [Mapbox Maps SDK for iOS](https://docs.mapbox.com/ios/maps/) or [macOS SDK](https://mapbox.github.io/mapbox-gl-native/macos/), you can easily draw the route on a map: ```swift // main.swift @@ -317,24 +172,6 @@ if route.coordinateCount > 0 { } ``` -```objc -// main.m - -if (route.coordinateCount) { - // Convert the route’s coordinates into a polyline. - CLLocationCoordinate2D *routeCoordinates = malloc(route.coordinateCount * sizeof(CLLocationCoordinate2D)); - [route getCoordinates:routeCoordinates]; - MGLPolyline *routeLine = [MGLPolyline polylineWithCoordinates:routeCoordinates count:route.coordinateCount]; - - // Add the polyline to the map and fit the viewport to the polyline. - [mapView addAnnotation:routeLine]; - [mapView setVisibleCoordinates:routeCoordinates count:route.coordinateCount edgePadding:UIEdgeInsetsZero animated:YES]; - - // Make sure to free this array to avoid leaking memory. - free(routeCoordinates); -} -``` - ### Displaying a turn-by-turn navigation interface See the [Mapbox Navigation SDK for iOS](https://github.com/mapbox/mapbox-navigation-ios/#usage) documentation for usage examples. diff --git a/Sources/CMapboxDirections/MBRouteOptions.m b/Sources/CMapboxDirections/MBRouteOptions.m deleted file mode 100644 index 34334686a..000000000 --- a/Sources/CMapboxDirections/MBRouteOptions.m +++ /dev/null @@ -1,11 +0,0 @@ -#import "MBRouteOptions.h" - - -MBDirectionsProfileIdentifier const MBDirectionsProfileIdentifierAutomobile = @"mapbox/driving"; -MBDirectionsProfileIdentifier const MBDirectionsProfileIdentifierAutomobileAvoidingTraffic = @"mapbox/driving-traffic"; -MBDirectionsProfileIdentifier const MBDirectionsProfileIdentifierCycling = @"mapbox/cycling"; -MBDirectionsProfileIdentifier const MBDirectionsProfileIdentifierWalking = @"mapbox/walking"; - -const MBDirectionsPriority MBDirectionsPriorityLow = -1.0; -const MBDirectionsPriority MBDirectionsPriorityDefault = 0; -const MBDirectionsPriority MBDirectionsPriorityHigh = 1.0; diff --git a/Sources/CMapboxDirections/include/CMapboxDirections.h b/Sources/CMapboxDirections/include/CMapboxDirections.h deleted file mode 100644 index d7ae267ef..000000000 --- a/Sources/CMapboxDirections/include/CMapboxDirections.h +++ /dev/null @@ -1,4 +0,0 @@ -#import "MBAttribute.h" -#import "MBLaneIndication.h" -#import "MBRoadClasses.h" -#import "MBRouteOptions.h" diff --git a/Sources/CMapboxDirections/include/MBAttribute.h b/Sources/CMapboxDirections/include/MBAttribute.h deleted file mode 100644 index d159fe8e0..000000000 --- a/Sources/CMapboxDirections/include/MBAttribute.h +++ /dev/null @@ -1,38 +0,0 @@ -#import - -/** - Attributes are metadata information for a route leg. - - When any of the attributes are specified, the resulting route leg contains one attribute value for each segment in leg, where a segment is the straight line between two coordinates in the route leg’s full geometry. - */ -typedef NS_OPTIONS(NSUInteger, MBAttributeOptions) { - /** - Distance (in meters) along the segment. - - When this attribute is specified, the `RouteLeg.segmentDistances` property contains one value for each segment in the leg’s full geometry. - */ - MBAttributeDistance = (1 << 1), - - /** - Expected travel time (in seconds) along the segment. - - When this attribute is specified, the `RouteLeg.expectedSegmentTravelTimes` property contains one value for each segment in the leg’s full geometry. - */ - MBAttributeExpectedTravelTime = (1 << 2), - - /** - Current average speed (in meters per second) along the segment. - - When this attribute is specified, the `RouteLeg.segmentSpeeds` property contains one value for each segment in the leg’s full geometry. - */ - MBAttributeSpeed = (1 << 3), - - /** - Traffic congestion level along the segment. - - When this attribute is specified, the `RouteLeg.congestionLevels` property contains one value for each segment in the leg’s full geometry. - - This attribute requires `MBDirectionsProfileIdentifierAutomobileAvoidingTraffic`. Any other profile identifier produces `CongestionLevel.unknown` for each segment along the route. - */ - MBAttributeCongestionLevel = (1 << 4), -}; diff --git a/Sources/CMapboxDirections/include/MBLaneIndication.h b/Sources/CMapboxDirections/include/MBLaneIndication.h deleted file mode 100644 index 525ad70f0..000000000 --- a/Sources/CMapboxDirections/include/MBLaneIndication.h +++ /dev/null @@ -1,35 +0,0 @@ -#import - -/** - Each of these options specifies a maneuver direction for which a given lane can - be used. - - A Lane object has zero or more indications that usually correspond to arrows on - signs or pavement markings. If no options are specified, it may be the case - that no maneuvers are indicated on signage or pavement markings for the lane. - */ -typedef NS_OPTIONS(NSUInteger, MBLaneIndication) { - /// Indicates a sharp turn to the right. - MBLaneIndicationSharpRight = (1 << 1), - - /// Indicates a turn to the right. - MBLaneIndicationRight = (1 << 2), - - /// Indicates a turn to the right. - MBLaneIndicationSlightRight = (1 << 3), - - /// Indicates no turn. - MBLaneIndicationStraightAhead = (1 << 4), - - /// Indicates a slight turn to the left. - MBLaneIndicationSlightLeft = (1 << 5), - - /// Indicates a turn to the left. - MBLaneIndicationLeft = (1 << 6), - - /// Indicates a sharp turn to the left. - MBLaneIndicationSharpLeft = (1 << 7), - - /// Indicates a U-turn. - MBLaneIndicationUTurn = (1 << 8), -}; diff --git a/Sources/CMapboxDirections/include/MBRoadClasses.h b/Sources/CMapboxDirections/include/MBRoadClasses.h deleted file mode 100644 index 0409f5172..000000000 --- a/Sources/CMapboxDirections/include/MBRoadClasses.h +++ /dev/null @@ -1,40 +0,0 @@ -#import - -/** - Option set that contains attributes of a road segment. - */ -typedef NS_OPTIONS(NSUInteger, MBRoadClasses) { - - /** - The road segment is [tolled](https://wiki.openstreetmap.org/wiki/Key:toll). - */ - MBRoadClassesToll = (1 << 1), - - /** - The road segment has access restrictions. - - A road segment may have this class if there are [general access restrictions](https://wiki.openstreetmap.org/wiki/Key:access) or a [high-occupancy vehicle](https://wiki.openstreetmap.org/wiki/Key:hov) restriction. - */ - MBRoadClassesRestricted = (1 << 2), - - /** - The road segment is a [freeway](https://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway) or [freeway ramp](https://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway_link). - - It may be desirable to suppress the name of the freeway when giving instructions and give instructions at fixed distances before an exit (such as 1 mile or 1 kilometer ahead). - */ - MBRoadClassesMotorway = (1 << 3), - - /** - The user must travel this segment of the route by ferry. - - The user should verify that the ferry is in operation. For driving and cycling directions, the user should also verify that his or her vehicle is permitted onboard the ferry. - - In general, the transport type of the step containing the road segment is also `TransportType.ferry`. - */ - MBRoadClassesFerry = (1 << 4), - - /** - The user must travel this segment of the route through a [tunnel](https://wiki.openstreetmap.org/wiki/Key:tunnel). - */ - MBRoadClassesTunnel = (1 << 5), -}; diff --git a/Sources/CMapboxDirections/include/MBRouteOptions.h b/Sources/CMapboxDirections/include/MBRouteOptions.h deleted file mode 100644 index c3f12179d..000000000 --- a/Sources/CMapboxDirections/include/MBRouteOptions.h +++ /dev/null @@ -1,58 +0,0 @@ -#import - -#pragma mark - Specifying the Routing Profile - -/** - Options determining the primary mode of transportation for the routes. - */ -typedef NSString * MBDirectionsProfileIdentifier NS_EXTENSIBLE_STRING_ENUM; - -/** - The returned directions are appropriate for driving or riding a car, truck, or motorcycle. - - This profile prioritizes fast routes by preferring high-speed roads like highways. A driving route may use a ferry where necessary. - */ -extern MBDirectionsProfileIdentifier const MBDirectionsProfileIdentifierAutomobile; - -/** - The returned directions are appropriate for driving or riding a car, truck, or motorcycle. - - This profile avoids traffic congestion based on current traffic data. A driving route may use a ferry where necessary. - - Traffic data is available in [a number of countries and territories worldwide](https://docs.mapbox.com/help/how-mapbox-works/directions/#traffic-data). Where traffic data is unavailable, this profile prefers high-speed roads like highways, similar to `MBDirectionsProfileIdentifierAutomobile`. - */ -extern MBDirectionsProfileIdentifier const MBDirectionsProfileIdentifierAutomobileAvoidingTraffic; - -/** - The returned directions are appropriate for riding a bicycle. - - This profile prioritizes short, safe routes by avoiding highways and preferring cycling infrastructure, such as bike lanes on surface streets. A cycling route may, where necessary, use other modes of transportation, such as ferries or trains, or require dismounting the bicycle for a distance. - */ -extern MBDirectionsProfileIdentifier const MBDirectionsProfileIdentifierCycling; - -/** - The returned directions are appropriate for walking or hiking. - - This profile prioritizes short routes, making use of sidewalks and trails where available. A walking route may use other modes of transportation, such as ferries or trains, where necessary. - */ -extern MBDirectionsProfileIdentifier const MBDirectionsProfileIdentifierWalking; - -/** - A number that influences whether a route should prefer or avoid roadways or pathways of a given type. - */ -typedef double MBDirectionsPriority NS_TYPED_EXTENSIBLE_ENUM; - -/** - The priority level with which a route avoids a particular type of roadway or pathway. - */ -extern const MBDirectionsPriority MBDirectionsPriorityLow; - -/** - The priority level with which a route neither avoids nor prefers a particular type of roadway or pathway. - */ -extern const MBDirectionsPriority MBDirectionsPriorityDefault; - -/** - The priority level with which a route prefers a particular type of roadway or pathway. - */ -extern const MBDirectionsPriority MBDirectionsPriorityHigh; diff --git a/Sources/MapboxDirections/AttributeOptions.swift b/Sources/MapboxDirections/AttributeOptions.swift new file mode 100644 index 000000000..5d8c9dac2 --- /dev/null +++ b/Sources/MapboxDirections/AttributeOptions.swift @@ -0,0 +1,88 @@ +import Foundation +#if SWIFT_PACKAGE +import CMapboxDirections +#endif + + + +public struct AttributeOptions: OptionSet, CustomStringConvertible { + public typealias RawValue = Int + + public var rawValue: Int + + public init(rawValue: AttributeOptions.RawValue) { + self.rawValue = rawValue + } + + /** + Distance (in meters) along the segment. + + When this attribute is specified, the `RouteLeg.segmentDistances` property contains one value for each segment in the leg’s full geometry. + */ + static let distance = AttributeOptions(rawValue: 1 << 1) + + /** + Expected travel time (in seconds) along the segment. + + When this attribute is specified, the `RouteLeg.expectedSegmentTravelTimes` property contains one value for each segment in the leg’s full geometry. + */ + static let expectedTravelTime = AttributeOptions(rawValue: 1 << 2) + + /** + Current average speed (in meters per second) along the segment. + + When this attribute is specified, the `RouteLeg.segmentSpeeds` property contains one value for each segment in the leg’s full geometry. + */ + static let speed = AttributeOptions(rawValue: 1 << 3) + + /** + Traffic congestion level along the segment. + + When this attribute is specified, the `RouteLeg.congestionLevels` property contains one value for each segment in the leg’s full geometry. + + This attribute requires `MBDirectionsProfileIdentifierAutomobileAvoidingTraffic`. Any other profile identifier produces `CongestionLevel.unknown` for each segment along the route. + */ + static let congestionLevel = AttributeOptions(rawValue: 1 << 4) + + + /** + Creates an AttributeOptions from the given description strings. + */ + public init?(descriptions: [String]) { + var attributeOptions: AttributeOptions = [] + for description in descriptions { + switch description { + case "distance": + attributeOptions.update(with: .distance) + case "duration": + attributeOptions.update(with: .expectedTravelTime) + case "speed": + attributeOptions.update(with: .speed) + case "congestion": + attributeOptions.update(with: .congestionLevel) + case "": + continue + default: + return nil + } + } + self.init(rawValue: attributeOptions.rawValue) + } + + public var description: String { + var descriptions: [String] = [] + if contains(.distance) { + descriptions.append("distance") + } + if contains(.expectedTravelTime) { + descriptions.append("duration") + } + if contains(.speed) { + descriptions.append("speed") + } + if contains(.congestionLevel) { + descriptions.append("congestion") + } + return descriptions.joined(separator: ",") + } +} diff --git a/Sources/MapboxDirections/DirectionsProfileIdentifier.swift b/Sources/MapboxDirections/DirectionsProfileIdentifier.swift new file mode 100644 index 000000000..bff9ed354 --- /dev/null +++ b/Sources/MapboxDirections/DirectionsProfileIdentifier.swift @@ -0,0 +1,67 @@ +import Foundation + +@available(*, deprecated, renamed: "DirectionsProfileIdentifier") +public typealias MBDirectionsProfileIdentifier = DirectionsProfileIdentifier + + +/** +The returned directions are appropriate for driving or riding a car, truck, or motorcycle. + +This profile prioritizes fast routes by preferring high-speed roads like highways. A driving route may use a ferry where necessary. +*/ +public struct DirectionsProfileIdentifier: RawRepresentable { + public init?(rawValue: String) { + self.rawValue = rawValue + } + + public var rawValue: String + + public typealias RawValue = String + + /** + The returned directions are appropriate for driving or riding a car, truck, or motorcycle. + + This profile prioritizes fast routes by preferring high-speed roads like highways. A driving route may use a ferry where necessary. + */ + static let automobile: String = "mapbox/driving" + + /** + The returned directions are appropriate for driving or riding a car, truck, or motorcycle. + + This profile avoids traffic congestion based on current traffic data. A driving route may use a ferry where necessary. + + Traffic data is available in [a number of countries and territories worldwide](https://docs.mapbox.com/help/how-mapbox-works/directions/#traffic-data). Where traffic data is unavailable, this profile prefers high-speed roads like highways, similar to `DirectionsProfileIdentifier.Automobile`. + */ + static let automobileAvoidingTraffic: String = "mapbox/driving-traffic" + + /** + The returned directions are appropriate for riding a bicycle. + + This profile prioritizes short, safe routes by avoiding highways and preferring cycling infrastructure, such as bike lanes on surface streets. A cycling route may, where necessary, use other modes of transportation, such as ferries or trains, or require dismounting the bicycle for a distance. + */ + static let cycling: String = "mapbox/cycling" + + /** + The returned directions are appropriate for walking or hiking. + + This profile prioritizes short routes, making use of sidewalks and trails where available. A walking route may use other modes of transportation, such as ferries or trains, where necessary. + */ + static let walking: String = "mapbox/walking" +} + +@available(*, deprecated, renamed: "DirectionsPriority") +public typealias MBDirectionsPriority = DirectionsPriority + +public struct DirectionsPriority: RawRepresentable { + public init?(rawValue: Double) { + self.rawValue = rawValue + } + + public var rawValue: Double + + public typealias RawValue = Double + + static let low = -1.0 + static let `default` = 0.0 + static let high = 1.0 +} diff --git a/Sources/MapboxDirections/MBAttribute.swift b/Sources/MapboxDirections/MBAttribute.swift deleted file mode 100644 index 2ea2b61b9..000000000 --- a/Sources/MapboxDirections/MBAttribute.swift +++ /dev/null @@ -1,50 +0,0 @@ -import Foundation -#if SWIFT_PACKAGE -import CMapboxDirections -#endif - - -public typealias AttributeOptions = MBAttributeOptions - -extension AttributeOptions: CustomStringConvertible { - /** - Creates an AttributeOptions from the given description strings. - */ - public init?(descriptions: [String]) { - var attributeOptions: AttributeOptions = [] - for description in descriptions { - switch description { - case "distance": - attributeOptions.update(with: .distance) - case "duration": - attributeOptions.update(with: .expectedTravelTime) - case "speed": - attributeOptions.update(with: .speed) - case "congestion": - attributeOptions.update(with: .congestionLevel) - case "": - continue - default: - return nil - } - } - self.init(rawValue: attributeOptions.rawValue) - } - - public var description: String { - var descriptions: [String] = [] - if contains(.distance) { - descriptions.append("distance") - } - if contains(.expectedTravelTime) { - descriptions.append("duration") - } - if contains(.speed) { - descriptions.append("speed") - } - if contains(.congestionLevel) { - descriptions.append("congestion") - } - return descriptions.joined(separator: ",") - } -} diff --git a/Sources/MapboxDirections/MBLaneIndication.swift b/Sources/MapboxDirections/MBLaneIndication.swift index 0b58e6278..72c07979d 100644 --- a/Sources/MapboxDirections/MBLaneIndication.swift +++ b/Sources/MapboxDirections/MBLaneIndication.swift @@ -4,10 +4,41 @@ import CMapboxDirections #endif -public typealias LaneIndication = MBLaneIndication +public struct LaneIndication: OptionSet, CustomStringConvertible { + public var rawValue: Int + + public init(rawValue: Int) { + self.rawValue = rawValue + } + + + public typealias RawValue = Int + /// Indicates a sharp turn to the right. + static let sharpRight = LaneIndication(rawValue: 1 << 1) + + /// Indicates a turn to the right. + static let right = LaneIndication(rawValue: 1 << 2) + + /// Indicates a turn to the right. + static let slightRight = LaneIndication(rawValue: 1 << 3) + + /// Indicates no turn. + static let straightAhead = LaneIndication(rawValue: 1 << 4) + + /// Indicates a slight turn to the left. + static let slightLeft = LaneIndication(rawValue: 1 << 5) + + /// Indicates a turn to the left. + static let left = LaneIndication(rawValue: 1 << 6) + + /// Indicates a sharp turn to the left. + static let sharpLeft = LaneIndication(rawValue: 1 << 7) + + /// Indicates a U-turn. + static let uTurn = LaneIndication(rawValue: 1 << 8) + -extension LaneIndication: CustomStringConvertible { /** Creates a lane indication from the given description strings. */ diff --git a/Sources/MapboxDirections/MBRoadClasses.swift b/Sources/MapboxDirections/MBRoadClasses.swift deleted file mode 100644 index a4cffd973..000000000 --- a/Sources/MapboxDirections/MBRoadClasses.swift +++ /dev/null @@ -1,60 +0,0 @@ -import Foundation -#if SWIFT_PACKAGE -import CMapboxDirections -#endif - - -public typealias RoadClasses = MBRoadClasses - -extension RoadClasses: CustomStringConvertible { - - /** - Creates a `RoadClasses` given an array of strings. - */ - public init?(descriptions: [String]) { - var roadClasses: RoadClasses = [] - for description in descriptions { - switch description { - case "toll": - roadClasses.insert(.toll) - case "restricted": - roadClasses.insert(.restricted) - case "motorway": - roadClasses.insert(.motorway) - case "ferry": - roadClasses.insert(.ferry) - case "tunnel": - roadClasses.insert(.tunnel) - case "none": - break - default: - return nil - } - } - self.init(rawValue: roadClasses.rawValue) - } - - public var description: String { - if isEmpty { - return "" - } - - var descriptions: [String] = [] - if contains(.toll) { - descriptions.append("toll") - } - if contains(.restricted) { - descriptions.append("restricted") - } - if contains(.motorway) { - descriptions.append("motorway") - } - if contains(.ferry) { - descriptions.append("ferry") - } - if contains(.tunnel) { - descriptions.append("tunnel") - } - return descriptions.joined(separator: ",") - } -} diff --git a/Sources/MapboxDirections/MapboxDirections.h b/Sources/MapboxDirections/MapboxDirections.h index 1e8203993..97e6721f7 100644 --- a/Sources/MapboxDirections/MapboxDirections.h +++ b/Sources/MapboxDirections/MapboxDirections.h @@ -6,7 +6,3 @@ FOUNDATION_EXPORT double MapboxDirectionsVersionNumber; //! Project version string for MapboxDirections. FOUNDATION_EXPORT const unsigned char MapboxDirectionsVersionString[]; - -#if !SWIFT_PACKAGE -#import "CMapboxDirections.h" -#endif diff --git a/Sources/MapboxDirections/Match/MBMatchOptions.swift b/Sources/MapboxDirections/Match/MBMatchOptions.swift index 28ee79759..920a4db13 100644 --- a/Sources/MapboxDirections/Match/MBMatchOptions.swift +++ b/Sources/MapboxDirections/Match/MBMatchOptions.swift @@ -10,8 +10,6 @@ import CMapboxDirections Pass an instance of this class into the `Directions.calculate(_:completionHandler:)` method. */ -@objcMembers -@objc(MBMatchOptions) open class MatchOptions: DirectionsOptions { /** @@ -20,7 +18,7 @@ open class MatchOptions: DirectionsOptions { - parameter locations: An array of `CLLocation` objects representing locations to attempt to match against the road network. The array should contain at least two locations (the source and destination) and at most 100 locations. (Some profiles, such as `MBDirectionsProfileIdentifierAutomobileAvoidingTraffic`, [may have lower limits](https://docs.mapbox.com/api/navigation/#directions).) - parameter profileIdentifier: A string specifying the primary mode of transportation for the routes. This parameter, if set, should be set to `MBDirectionsProfileIdentifierAutomobile`, `MBDirectionsProfileIdentifierAutomobileAvoidingTraffic`, `MBDirectionsProfileIdentifierCycling`, or `MBDirectionsProfileIdentifierWalking`. `MBDirectionsProfileIdentifierAutomobile` is used by default. */ - @objc public convenience init(locations: [CLLocation], profileIdentifier: MBDirectionsProfileIdentifier? = nil) { + public convenience init(locations: [CLLocation], profileIdentifier: MBDirectionsProfileIdentifier? = nil) { let waypoints = locations.map { Waypoint(location: $0) } @@ -33,21 +31,21 @@ open class MatchOptions: DirectionsOptions { - parameter coordinates: An array of geographic coordinates representing locations to attempt to match against the road network. The array should contain at least two locations (the source and destination) and at most 100 locations. (Some profiles, such as `MBDirectionsProfileIdentifierAutomobileAvoidingTraffic`, [may have lower limits](https://docs.mapbox.com/api/navigation/#directions).) Each coordinate is converted into a `Waypoint` object. - parameter profileIdentifier: A string specifying the primary mode of transportation for the routes. This parameter, if set, should be set to `MBDirectionsProfileIdentifierAutomobile`, `MBDirectionsProfileIdentifierAutomobileAvoidingTraffic`, `MBDirectionsProfileIdentifierCycling`, or `MBDirectionsProfileIdentifierWalking`. `MBDirectionsProfileIdentifierAutomobile` is used by default. */ - @objc public convenience init(coordinates: [CLLocationCoordinate2D], profileIdentifier: MBDirectionsProfileIdentifier? = nil) { + public convenience init(coordinates: [CLLocationCoordinate2D], profileIdentifier: MBDirectionsProfileIdentifier? = nil) { let waypoints = coordinates.map { Waypoint(coordinate: $0) } self.init(waypoints: waypoints, profileIdentifier: profileIdentifier) } - @objc public required init(waypoints: [Waypoint], profileIdentifier: MBDirectionsProfileIdentifier?) { + public required init(waypoints: [Waypoint], profileIdentifier: MBDirectionsProfileIdentifier?) { super.init(waypoints: waypoints, profileIdentifier: profileIdentifier) } /** If true, the input locations are re-sampled for improved map matching results. The default is `false`. */ - @objc open var resamplesTraces: Bool = false + open var resamplesTraces: Bool = false /** diff --git a/Sources/MapboxDirections/RoadClasses.swift b/Sources/MapboxDirections/RoadClasses.swift new file mode 100644 index 000000000..de439871d --- /dev/null +++ b/Sources/MapboxDirections/RoadClasses.swift @@ -0,0 +1,105 @@ +import Foundation +#if SWIFT_PACKAGE +import CMapboxDirections +#endif + + +/** +Option set that contains attributes of a road segment. +*/ +public struct RoadClasses: OptionSet, CustomStringConvertible { + public var rawValue: Int + + public init(rawValue: Int) { + self.rawValue = rawValue + } + + + public typealias RawValue = Int + + + /** + The road segment is [tolled](https://wiki.openstreetmap.org/wiki/Key:toll). + */ + static let toll = RoadClasses(rawValue: 1 << 1) + + /** + The road segment has access restrictions. + + A road segment may have this class if there are [general access restrictions](https://wiki.openstreetmap.org/wiki/Key:access) or a [high-occupancy vehicle](https://wiki.openstreetmap.org/wiki/Key:hov) restriction. + */ + static let restricted = RoadClasses(rawValue: 1 << 2) + + /** + The road segment is a [freeway](https://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway) or [freeway ramp](https://wiki.openstreetmap.org/wiki/Tag:highway%3Dmotorway_link). + + It may be desirable to suppress the name of the freeway when giving instructions and give instructions at fixed distances before an exit (such as 1 mile or 1 kilometer ahead). + */ + static let motorway = RoadClasses(rawValue: 1 << 3) + + /** + The user must travel this segment of the route by ferry. + + The user should verify that the ferry is in operation. For driving and cycling directions, the user should also verify that his or her vehicle is permitted onboard the ferry. + + In general, the transport type of the step containing the road segment is also `TransportType.ferry`. + */ + static let ferry = RoadClasses(rawValue: 1 << 4) + + /** + The user must travel this segment of the route through a [tunnel](https://wiki.openstreetmap.org/wiki/Key:tunnel). + */ + static let tunnel = RoadClasses(rawValue: 1 << 5) + + + + /** + Creates a `RoadClasses` given an array of strings. + */ + public init?(descriptions: [String]) { + var roadClasses: RoadClasses = [] + for description in descriptions { + switch description { + case "toll": + roadClasses.insert(.toll) + case "restricted": + roadClasses.insert(.restricted) + case "motorway": + roadClasses.insert(.motorway) + case "ferry": + roadClasses.insert(.ferry) + case "tunnel": + roadClasses.insert(.tunnel) + case "none": + break + default: + return nil + } + } + self.init(rawValue: roadClasses.rawValue) + } + + public var description: String { + if isEmpty { + return "" + } + + var descriptions: [String] = [] + if contains(.toll) { + descriptions.append("toll") + } + if contains(.restricted) { + descriptions.append("restricted") + } + if contains(.motorway) { + descriptions.append("motorway") + } + if contains(.ferry) { + descriptions.append("ferry") + } + if contains(.tunnel) { + descriptions.append("tunnel") + } + return descriptions.joined(separator: ",") + } +} diff --git a/Tests/objc/BridgingTests.m b/Tests/objc/BridgingTests.m deleted file mode 100644 index 764f98f1a..000000000 --- a/Tests/objc/BridgingTests.m +++ /dev/null @@ -1,83 +0,0 @@ -#import -#import -@import MapboxDirections; - -@interface BridgingTests : XCTestCase -@end - -@implementation BridgingTests - -- (void)testDirections { - NSArray *locations = @[[[CLLocation alloc] initWithLatitude:0 longitude:1], - [[CLLocation alloc] initWithLatitude:2 longitude:3]]; - - MBRouteOptions *options = [[MBRouteOptions alloc] initWithLocations:locations - profileIdentifier:MBDirectionsProfileIdentifierAutomobileAvoidingTraffic]; - - MBDirections *directions = [[MBDirections alloc] initWithAccessToken:@"foo"]; - [directions calculateDirectionsWithOptions:options - completionHandler:^(NSArray * _Nullable waypoints, NSArray * _Nullable routes, NSError * _Nullable error) { - - }]; - - MBMatchOptions *matchOptions = [[MBMatchOptions alloc] initWithLocations:locations profileIdentifier:MBDirectionsProfileIdentifierAutomobileAvoidingTraffic]; - - XCTAssertNotNil(matchOptions); -} - -- (void)testRouteOptions { - NSArray *locations = @[[[CLLocation alloc] initWithLatitude:0 longitude:1], - [[CLLocation alloc] initWithLatitude:2 longitude:3]]; - -// NSArray *coordinates = @[[NSValue valueWithMKCoordinate:CLLocationCoordinate2DMake(0, 1)], -// [NSValue valueWithMKCoordinate:CLLocationCoordinate2DMake(2, 3)]]; - - NSArray *waypoints = @[[[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(0, 1) coordinateAccuracy:-1 name:nil], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(2, 3) coordinateAccuracy:-1 name:nil]]; - - MBRouteOptions *options = nil; - - options = [[MBRouteOptions alloc] initWithLocations:locations profileIdentifier:MBDirectionsProfileIdentifierAutomobileAvoidingTraffic]; -// options = [[MBRouteOptions alloc] initWithCoordinates:coordinates profileIdentifier:MBDirectionsProfileIdentifierAutomobileAvoidingTraffic]; - options = [[MBRouteOptions alloc] initWithWaypoints:waypoints profileIdentifier:MBDirectionsProfileIdentifierAutomobileAvoidingTraffic]; -} - -- (void)testRoute { - NSString *filePath = [[NSBundle bundleForClass:[BridgingTests class]] pathForResource:@"subLaneInstructions" ofType:@"json"]; - NSURL *fileURL = [NSURL fileURLWithPath:filePath]; - NSData *data = [NSData dataWithContentsOfURL:fileURL]; - NSDictionary *response = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; - NSArray *routes = [response objectForKey:@"routes"]; - NSDictionary *routeDict = routes[0]; - - NSArray *waypoints = @[[[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(0, 1) coordinateAccuracy:-1 name:nil], - [[MBWaypoint alloc] initWithCoordinate:CLLocationCoordinate2DMake(2, 3) coordinateAccuracy:-1 name:nil]]; - - MBRouteOptions *options = [[MBRouteOptions alloc] initWithWaypoints:waypoints profileIdentifier:MBDirectionsProfileIdentifierAutomobileAvoidingTraffic]; - - MBRoute *route = [[MBRoute alloc] initWithJSON:routeDict waypoints:waypoints routeOptions:options]; - - MBRouteLeg *leg = route.legs[0]; - MBRouteStep *step = leg.steps[0]; - - MBVisualInstructionBanner *banner = step.instructionsDisplayedAlongStep[0]; - MBVisualInstruction *visualInstruction = banner.primaryInstruction; - - MBManeuverType type = visualInstruction.maneuverType; - MBManeuverDirection direction = visualInstruction.maneuverDirection; - - MBVisualInstruction *teriaryInstruction = banner.tertiaryInstruction; - NSArray> *components = teriaryInstruction.components; - - MBLaneIndicationComponent *component = (MBLaneIndicationComponent *)components[0]; - MBLaneIndication indications = component.indications; - - XCTAssertNotNil(leg); - XCTAssertNotNil(step); - XCTAssertNotNil(banner); - XCTAssertEqual(type, MBManeuverTypeTurn); - XCTAssertEqual(direction, MBManeuverDirectionRight); - XCTAssertEqual(indications, MBLaneIndicationStraightAhead); -} - -@end