diff --git a/.jazzy.yaml b/.jazzy.yaml index 2516841..694997f 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -1,7 +1,7 @@ # MapirServices document generator jazzy settings copyright: Copyright 1398 Map -author: Alireza Asadi +author: Map xcodebuild_arguments: [-target, MapirServices-iOS] clean: true output: ./Documentation diff --git a/Example/Resources/Info.plist b/Example/Resources/Info.plist index 56dbe88..bfd218d 100644 --- a/Example/Resources/Info.plist +++ b/Example/Resources/Info.plist @@ -2,8 +2,6 @@ - MAPIRAccessToken - sag CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) CFBundleDisplayName diff --git a/Example/ViewController.swift b/Example/ViewController.swift index c5ac21c..5e09094 100644 --- a/Example/ViewController.swift +++ b/Example/ViewController.swift @@ -42,7 +42,7 @@ class ViewController: UIViewController { let size = CGSize(width: 300, height: 250) let marker = MPSStaticMapMarker(coordinate: coordinates, style: MPSStaticMapMarker.Style.red, label: "mapir") - mps.getStaticMap(center: coordinates, + mps.staticMap(center: coordinates, size: size, zoomLevel: 15, markers: [marker]) { (result) in @@ -60,23 +60,23 @@ class ViewController: UIViewController { } } - mps.getReverseGeocode(for: coordinates) { (result) in + mps.reverseGeocode(for: coordinates) { (result) in switch result { case .success(let reverse): print("getReverseGeocode method for (\(coordinates.latitude), \(coordinates.longitude)) was successful.") print("---> address is: \(reverse.address ?? "nil")") case .failure(let error): - print("getReverseGeocode failed with error: \(error.localizedDescription)") + print("getReverseGeocode failed with error: \(error)") } } - mps.getFastReverseGeocode(for: coordinates) { (result) in + mps.fastReverseGeocode(for: coordinates) { (result) in switch result { case .success(let reverse): print("getFastReverseGeocode method for (\(coordinates.latitude), \(coordinates.longitude)) was successful.") print("---> address is: \(reverse.address ?? "nil")") case .failure(let error): - print("getFastReverseGeocode failed with error: \(error.localizedDescription)") + print("getFastReverseGeocode failed with error: \(error)") } } @@ -88,10 +88,10 @@ class ViewController: UIViewController { let origins = [pointA, pointB] let destinations = [pointC, pointD] - mps.getDistanceMatrix(from: origins, to: destinations, options: .sorted) { (result) in + mps.distanceMatrix(from: origins, to: destinations, options: .sorted) { (result) in switch result { case .failure(let error): - print("getDistanceMatrix failed with error: \(error.localizedDescription)") + print("getDistanceMatrix failed with error: \(error)") case .success(let distanceMartix): print("getDistanceMatrix method was successful.") print("---> address is: \(distanceMartix)") @@ -100,39 +100,40 @@ class ViewController: UIViewController { let stringToSearch = "ساوجی نیا" - mps.getSearchResult(for: stringToSearch, around: coordinates, selectionOptions: [.poi, .roads], filter: .city("تهران")) { (result) in + mps.search(for: stringToSearch, around: coordinates, selectionOptions: [.poi, .roads], filter: .city("تهران")) { (result) in switch result { case .success(let searchResult): print("getSearchResult method was successful.") print("---> Search result is: \(searchResult)") case .failure(let error): - print("getSearchResult failed with error: \(error.localizedDescription)") + print("getSearchResult failed with error: \(error)") } } - mps.getAutocompleteSearchResult(for: stringToSearch, around: coordinates, selectionOptions: [.poi, .roads]) { (result) in + mps.autocomplete(for: stringToSearch, around: coordinates, selectionOptions: [.poi, .roads]) { (result) in switch result { case .success(let searchResult): print("getAutocompleteSearchResult method was successful.") print("---> Autocomplete search result is: \(searchResult)") case .failure(let error): - print("getAutocompleteSearchResult failed with error: \(error.localizedDescription)") + print("getAutocompleteSearchResult failed with error: \(error)") } } - mps.getRoute(from: pointA, - to: [pointB, pointC], - routeType: .drivingNoExclusion, - routeOptions: .calculateAlternatives) { (result) in - switch result { - case .success(let route): - print("getRoute method was successful.") - print("---> Route result is: \(route)") - case .failure(let error): - print("getRoute failed with error: \(error)") - } - } + mps.route(from: pointA, + to: [pointB, pointC], + routeMode: .drivingNoExclusion, + routeOptions: .calculateAlternatives) { (result) in + switch result { + case .success(let (waypoint, route)): + print("getRoute method was successful.") + print("---> Waypoint result(s) is: \(waypoint)") + print("---> Route result(s) is: \(route)") + case .failure(let error): + print("getRoute failed with error: \(error)") + } + } } /// LoadView diff --git a/MapirServices.podspec b/MapirServices.podspec index 17b30bc..f99b6ea 100644 --- a/MapirServices.podspec +++ b/MapirServices.podspec @@ -1,36 +1,41 @@ Pod::Spec.new do |s| s.name = "MapirServices" - s.version = "0.1.0" + s.version = "0.2.0" s.summary = "a SDK to access services of map.ir." s.homepage = "https://support.map.ir/" + s.social_media_url = 'https://twitter.com/map_ir_Official' s.license = { :type => "MIT", :file => "LICENSE" } - s.author = { "Map.ir" => "a.asadi@map.ir" } - s.source = { :git => "https://github.com/map-ir/ios-sdk-v1-services-beta", :tag => s.version } + s.author = { "Map.ir" => "support@map.ir", + "Alireza Asadi" => "a.asadi@map.ir" } + s.documentation_url = 'https://support.map.ir/developers/iservice/' + s.source = { :git => "https://github.com/map-ir/ios-sdk-v1-services-beta", :tag => s.version.to_s } - s.platform = :ios - s.ios.deployment_target = "10.0" - s.module_name = "MapirServiecs" - - # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # --- iOS ------------------------------------------------- # + s.ios.deployment_target = '9.0' + s.ios.framework = 'UIKit' - s.source_files = "Sources/**/*.swift" + # --- macOS ----------------------------------------------- # + s.osx.deployment_target = '10.10' + s.osx.framework = 'AppKit' - # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # --- watchOS --------------------------------------------- # + s.watchos.deployment_target = '3.0' + s.watchos.framework = 'UIKit' - s.resources = ['MapirServices/Resources/*/*', 'MapirServices/Resources/*'] + # --- tvOS ------------------------------------------------ # + s.tvos.deployment_target = '9.0' + s.tvos.framework = 'UIKit' - # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + s.requires_arc = true + s.module_name = "MapirServiecs" + s.swift_version = '5.0' + s.source_files = "Sources/**/*.{swift, h}" - s.requires_arc = true + s.frameworks = "Foundation", "CoreLocation" s.dependency "Polyline", "~> 4.2.1" - s.swift_version = '5.0' - - - s.frameworks = "Foundation", "CoreLocation" - end diff --git a/MapirServices.xcodeproj/project.pbxproj b/MapirServices.xcodeproj/project.pbxproj index a7bec7f..9cc831f 100644 --- a/MapirServices.xcodeproj/project.pbxproj +++ b/MapirServices.xcodeproj/project.pbxproj @@ -3,24 +3,9 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 51; objects = { -/* Begin PBXAggregateTarget section */ - C035B3EE22DB4F340083BBD4 /* UniversalBinary */ = { - isa = PBXAggregateTarget; - buildConfigurationList = C035B3F122DB4F350083BBD4 /* Build configuration list for PBXAggregateTarget "UniversalBinary" */; - buildPhases = ( - C035B3F322DB93820083BBD4 /* SwiftLint */, - C035B3F222DB4F530083BBD4 /* Build Process */, - ); - dependencies = ( - ); - name = UniversalBinary; - productName = UniversalBinary; - }; -/* End PBXAggregateTarget section */ - /* Begin PBXBuildFile section */ 3D9C42A222745900000A6585 /* MapirServices.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9C42A122745900000A6585 /* MapirServices.swift */; }; 3D9C42F62274604A000A6585 /* MapirServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D9C429022745894000A6585 /* MapirServices.framework */; }; @@ -31,6 +16,7 @@ 3D9C432E2274629C000A6585 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 3D9C432C2274629C000A6585 /* LaunchScreen.storyboard */; }; 3D9C433422746323000A6585 /* MapirServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D9C429022745894000A6585 /* MapirServices.framework */; }; 3D9C433522746323000A6585 /* MapirServices.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3D9C429022745894000A6585 /* MapirServices.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C004681022E5DDD100CF922E /* MapirServices_macOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C004680722E5DDD000CF922E /* MapirServices_macOS.framework */; }; C02DCF6522CA1C9600BA403F /* MPSWaypoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6422CA1C9600BA403F /* MPSWaypoint.swift */; }; C02DCF6722CA1CE700BA403F /* MPSStep.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6622CA1CE700BA403F /* MPSStep.swift */; }; C02DCF6922CA1DC300BA403F /* MPSLeg.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6822CA1DC300BA403F /* MPSLeg.swift */; }; @@ -39,22 +25,107 @@ C02E70E122B11B6D0058BCA7 /* MPSError.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02E70E022B11B6D0058BCA7 /* MPSError.swift */; }; C04CF65F22A25E5D009761C4 /* MPSReverseGeocode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04CF65E22A25E5D009761C4 /* MPSReverseGeocode.swift */; }; C04CF66922A27D6E009761C4 /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04CF66822A27D6E009761C4 /* HTTPMethod.swift */; }; + C056047022E6ED0B004A2F9C /* Polyline.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C056046322E6ED01004A2F9C /* Polyline.framework */; }; + C056047122E6ED0B004A2F9C /* Polyline.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C056046322E6ED01004A2F9C /* Polyline.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C056047222E7098D004A2F9C /* MapirServices.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9C42A122745900000A6585 /* MapirServices.swift */; }; + C056047322E70993004A2F9C /* MPSReverseGeocode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04CF65E22A25E5D009761C4 /* MPSReverseGeocode.swift */; }; + C056047422E70993004A2F9C /* MPSFastReverseGeocode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C09704E822C363A000E2585C /* MPSFastReverseGeocode.swift */; }; + C056047522E70993004A2F9C /* MPSLocationCoordinate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C086ACFA22C34F6F004256EA /* MPSLocationCoordinate.swift */; }; + C056047622E70993004A2F9C /* MPSDistance.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9322C89A8200BC04EF /* MPSDistance.swift */; }; + C056047722E70993004A2F9C /* MPSDistanceMatrix.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9522C89A8200BC04EF /* MPSDistanceMatrix.swift */; }; + C056047822E70993004A2F9C /* MPSDuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9422C89A8200BC04EF /* MPSDuration.swift */; }; + C056047922E70993004A2F9C /* MPSLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9622C89A8200BC04EF /* MPSLocation.swift */; }; + C056047A22E70993004A2F9C /* MPSSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FDE22C9EBC800BC04EF /* MPSSearch.swift */; }; + C056047B22E70993004A2F9C /* MPSSearchResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE022C9EE2600BC04EF /* MPSSearchResult.swift */; }; + C056047C22E70993004A2F9C /* MPSAutocompleteResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE222CA002600BC04EF /* MPSAutocompleteResult.swift */; }; + C056047D22E70993004A2F9C /* MPSAutocomplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE422CA003400BC04EF /* MPSAutocomplete.swift */; }; + C056047E22E70993004A2F9C /* MPSStaticMapMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0FBFA2722D2009400A03FCC /* MPSStaticMapMarker.swift */; }; + C056047F22E7099B004A2F9C /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04CF66822A27D6E009761C4 /* HTTPMethod.swift */; }; + C056048022E7099B004A2F9C /* MPSError.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02E70E022B11B6D0058BCA7 /* MPSError.swift */; }; + C056048122E709A2004A2F9C /* MPSWaypoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6422CA1C9600BA403F /* MPSWaypoint.swift */; }; + C056048222E709A2004A2F9C /* MPSLeg.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6822CA1DC300BA403F /* MPSLeg.swift */; }; + C056048322E709A2004A2F9C /* MPSStep.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6622CA1CE700BA403F /* MPSStep.swift */; }; + C056048422E709A2004A2F9C /* MPSManeuver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6A22CA213000BA403F /* MPSManeuver.swift */; }; + C056048522E709A2004A2F9C /* MPSIntersection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6C22CA213B00BA403F /* MPSIntersection.swift */; }; + C056048622E709A2004A2F9C /* MPSLane.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB44C22CB302600FAE64A /* MPSLane.swift */; }; + C056048722E709A2004A2F9C /* MPSRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB44E22CB570800FAE64A /* MPSRoute.swift */; }; + C056048822E709A2004A2F9C /* MPSRouteResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0B79B2122D361BB005E9C24 /* MPSRouteResult.swift */; }; + C056048922E709A8004A2F9C /* CLLocationCoordinate2D+initFromArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB45922CC87E400FAE64A /* CLLocationCoordinate2D+initFromArray.swift */; }; + C056048A22E709C3004A2F9C /* Polyline.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C056046722E6ED01004A2F9C /* Polyline.framework */; }; + C056048B22E709C3004A2F9C /* Polyline.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C056046722E6ED01004A2F9C /* Polyline.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C056048D22E71B35004A2F9C /* MapirServicesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9C42D722745CDE000A6585 /* MapirServicesTests.swift */; }; + C05604A922E7204F004A2F9C /* MapirServices_tvOS.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C05604A022E7204F004A2F9C /* MapirServices_tvOS.framework */; }; + C05604BD22E737B6004A2F9C /* MapirServices.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9C42A122745900000A6585 /* MapirServices.swift */; }; + C05604BE22E737B6004A2F9C /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04CF66822A27D6E009761C4 /* HTTPMethod.swift */; }; + C05604BF22E737B6004A2F9C /* MPSError.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02E70E022B11B6D0058BCA7 /* MPSError.swift */; }; + C05604C022E737B6004A2F9C /* MPSReverseGeocode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04CF65E22A25E5D009761C4 /* MPSReverseGeocode.swift */; }; + C05604C122E737B6004A2F9C /* MPSFastReverseGeocode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C09704E822C363A000E2585C /* MPSFastReverseGeocode.swift */; }; + C05604C222E737B6004A2F9C /* MPSLocationCoordinate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C086ACFA22C34F6F004256EA /* MPSLocationCoordinate.swift */; }; + C05604C322E737B6004A2F9C /* MPSDistance.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9322C89A8200BC04EF /* MPSDistance.swift */; }; + C05604C422E737B6004A2F9C /* MPSDistanceMatrix.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9522C89A8200BC04EF /* MPSDistanceMatrix.swift */; }; + C05604C522E737B6004A2F9C /* MPSDuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9422C89A8200BC04EF /* MPSDuration.swift */; }; + C05604C622E737B6004A2F9C /* MPSLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9622C89A8200BC04EF /* MPSLocation.swift */; }; + C05604C722E737B6004A2F9C /* MPSSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FDE22C9EBC800BC04EF /* MPSSearch.swift */; }; + C05604C822E737B6004A2F9C /* MPSSearchResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE022C9EE2600BC04EF /* MPSSearchResult.swift */; }; + C05604C922E737B6004A2F9C /* MPSAutocompleteResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE222CA002600BC04EF /* MPSAutocompleteResult.swift */; }; + C05604CA22E737B6004A2F9C /* MPSAutocomplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE422CA003400BC04EF /* MPSAutocomplete.swift */; }; + C05604CB22E737B6004A2F9C /* MPSStaticMapMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0FBFA2722D2009400A03FCC /* MPSStaticMapMarker.swift */; }; + C05604CC22E737B6004A2F9C /* MPSWaypoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6422CA1C9600BA403F /* MPSWaypoint.swift */; }; + C05604CD22E737B6004A2F9C /* MPSLeg.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6822CA1DC300BA403F /* MPSLeg.swift */; }; + C05604CE22E737B6004A2F9C /* MPSStep.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6622CA1CE700BA403F /* MPSStep.swift */; }; + C05604CF22E737B6004A2F9C /* MPSManeuver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6A22CA213000BA403F /* MPSManeuver.swift */; }; + C05604D022E737B6004A2F9C /* MPSIntersection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6C22CA213B00BA403F /* MPSIntersection.swift */; }; + C05604D122E737B6004A2F9C /* MPSLane.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB44C22CB302600FAE64A /* MPSLane.swift */; }; + C05604D222E737B6004A2F9C /* MPSRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB44E22CB570800FAE64A /* MPSRoute.swift */; }; + C05604D322E737B6004A2F9C /* MPSRouteResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0B79B2122D361BB005E9C24 /* MPSRouteResult.swift */; }; + C05604D422E737B6004A2F9C /* CLLocationCoordinate2D+initFromArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB45922CC87E400FAE64A /* CLLocationCoordinate2D+initFromArray.swift */; }; + C05604DF22E737B7004A2F9C /* MapirServices.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9C42A122745900000A6585 /* MapirServices.swift */; }; + C05604E022E737B7004A2F9C /* HTTPMethod.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04CF66822A27D6E009761C4 /* HTTPMethod.swift */; }; + C05604E122E737B7004A2F9C /* MPSError.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02E70E022B11B6D0058BCA7 /* MPSError.swift */; }; + C05604E222E737B7004A2F9C /* MPSReverseGeocode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C04CF65E22A25E5D009761C4 /* MPSReverseGeocode.swift */; }; + C05604E322E737B7004A2F9C /* MPSFastReverseGeocode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C09704E822C363A000E2585C /* MPSFastReverseGeocode.swift */; }; + C05604E422E737B7004A2F9C /* MPSLocationCoordinate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C086ACFA22C34F6F004256EA /* MPSLocationCoordinate.swift */; }; + C05604E522E737B7004A2F9C /* MPSDistance.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9322C89A8200BC04EF /* MPSDistance.swift */; }; + C05604E622E737B7004A2F9C /* MPSDistanceMatrix.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9522C89A8200BC04EF /* MPSDistanceMatrix.swift */; }; + C05604E722E737B7004A2F9C /* MPSDuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9422C89A8200BC04EF /* MPSDuration.swift */; }; + C05604E822E737B7004A2F9C /* MPSLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9622C89A8200BC04EF /* MPSLocation.swift */; }; + C05604E922E737B7004A2F9C /* MPSSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FDE22C9EBC800BC04EF /* MPSSearch.swift */; }; + C05604EA22E737B7004A2F9C /* MPSSearchResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE022C9EE2600BC04EF /* MPSSearchResult.swift */; }; + C05604EB22E737B7004A2F9C /* MPSAutocompleteResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE222CA002600BC04EF /* MPSAutocompleteResult.swift */; }; + C05604EC22E737B7004A2F9C /* MPSAutocomplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE422CA003400BC04EF /* MPSAutocomplete.swift */; }; + C05604ED22E737B7004A2F9C /* MPSStaticMapMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0FBFA2722D2009400A03FCC /* MPSStaticMapMarker.swift */; }; + C05604EE22E737B7004A2F9C /* MPSWaypoint.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6422CA1C9600BA403F /* MPSWaypoint.swift */; }; + C05604EF22E737B7004A2F9C /* MPSLeg.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6822CA1DC300BA403F /* MPSLeg.swift */; }; + C05604F022E737B7004A2F9C /* MPSStep.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6622CA1CE700BA403F /* MPSStep.swift */; }; + C05604F122E737B7004A2F9C /* MPSManeuver.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6A22CA213000BA403F /* MPSManeuver.swift */; }; + C05604F222E737B7004A2F9C /* MPSIntersection.swift in Sources */ = {isa = PBXBuildFile; fileRef = C02DCF6C22CA213B00BA403F /* MPSIntersection.swift */; }; + C05604F322E737B7004A2F9C /* MPSLane.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB44C22CB302600FAE64A /* MPSLane.swift */; }; + C05604F422E737B7004A2F9C /* MPSRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB44E22CB570800FAE64A /* MPSRoute.swift */; }; + C05604F522E737B7004A2F9C /* MPSRouteResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0B79B2122D361BB005E9C24 /* MPSRouteResult.swift */; }; + C05604F622E737B7004A2F9C /* CLLocationCoordinate2D+initFromArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB45922CC87E400FAE64A /* CLLocationCoordinate2D+initFromArray.swift */; }; + C05604F722E737D2004A2F9C /* MapirServices.h in Headers */ = {isa = PBXBuildFile; fileRef = C004680922E5DDD000CF922E /* MapirServices.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C05604F822E737DA004A2F9C /* MapirServicesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9C42D722745CDE000A6585 /* MapirServicesTests.swift */; }; + C056051F22E739D5004A2F9C /* Polyline.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C056046B22E6ED01004A2F9C /* Polyline.framework */; }; + C056052022E739D5004A2F9C /* Polyline.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C056046B22E6ED01004A2F9C /* Polyline.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C056052222E739D9004A2F9C /* Polyline.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C056046F22E6ED01004A2F9C /* Polyline.framework */; }; + C056052322E739D9004A2F9C /* Polyline.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C056046F22E6ED01004A2F9C /* Polyline.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; C086ACFB22C34F6F004256EA /* MPSLocationCoordinate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C086ACFA22C34F6F004256EA /* MPSLocationCoordinate.swift */; }; C08DB44D22CB302600FAE64A /* MPSLane.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB44C22CB302600FAE64A /* MPSLane.swift */; }; C08DB44F22CB570800FAE64A /* MPSRoute.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB44E22CB570800FAE64A /* MPSRoute.swift */; }; C08DB45A22CC87E400FAE64A /* CLLocationCoordinate2D+initFromArray.swift in Sources */ = {isa = PBXBuildFile; fileRef = C08DB45922CC87E400FAE64A /* CLLocationCoordinate2D+initFromArray.swift */; }; C09704E922C363A000E2585C /* MPSFastReverseGeocode.swift in Sources */ = {isa = PBXBuildFile; fileRef = C09704E822C363A000E2585C /* MPSFastReverseGeocode.swift */; }; - C0B79B2222D361BC005E9C24 /* MPSRouteObject.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0B79B2122D361BB005E9C24 /* MPSRouteObject.swift */; }; - C0D3D3B722DF0687005419F3 /* Polyline.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C0D3D3B622DF0687005419F3 /* Polyline.framework */; platformFilter = ios; }; - C0D3D3B822DF0687005419F3 /* Polyline.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C0D3D3B622DF0687005419F3 /* Polyline.framework */; platformFilter = ios; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + C0B79B2222D361BC005E9C24 /* MPSRouteResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0B79B2122D361BB005E9C24 /* MPSRouteResult.swift */; }; C0EA4F9722C89A8300BC04EF /* MPSDistance.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9322C89A8200BC04EF /* MPSDistance.swift */; }; C0EA4F9822C89A8300BC04EF /* MPSDuration.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9422C89A8200BC04EF /* MPSDuration.swift */; }; C0EA4F9922C89A8300BC04EF /* MPSDistanceMatrix.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9522C89A8200BC04EF /* MPSDistanceMatrix.swift */; }; C0EA4F9A22C89A8300BC04EF /* MPSLocation.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4F9622C89A8200BC04EF /* MPSLocation.swift */; }; C0EA4FDF22C9EBC800BC04EF /* MPSSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FDE22C9EBC800BC04EF /* MPSSearch.swift */; }; C0EA4FE122C9EE2600BC04EF /* MPSSearchResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE022C9EE2600BC04EF /* MPSSearchResult.swift */; }; - C0EA4FE322CA002600BC04EF /* MPSAutocompleteSearchResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE222CA002600BC04EF /* MPSAutocompleteSearchResult.swift */; }; - C0EA4FE522CA003400BC04EF /* MPSAutocompleteSearch.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE422CA003400BC04EF /* MPSAutocompleteSearch.swift */; }; + C0EA4FE322CA002600BC04EF /* MPSAutocompleteResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE222CA002600BC04EF /* MPSAutocompleteResult.swift */; }; + C0EA4FE522CA003400BC04EF /* MPSAutocomplete.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE422CA003400BC04EF /* MPSAutocomplete.swift */; }; + C0FA896822E899A3003EB4E3 /* MapirServices.h in Headers */ = {isa = PBXBuildFile; fileRef = C004680922E5DDD000CF922E /* MapirServices.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0FA897022E899A4003EB4E3 /* MapirServices.h in Headers */ = {isa = PBXBuildFile; fileRef = C004680922E5DDD000CF922E /* MapirServices.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C0FA897122E899A4003EB4E3 /* MapirServices.h in Headers */ = {isa = PBXBuildFile; fileRef = C004680922E5DDD000CF922E /* MapirServices.h */; settings = {ATTRIBUTES = (Public, ); }; }; C0FBFA2822D2009400A03FCC /* MPSStaticMapMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0FBFA2722D2009400A03FCC /* MPSStaticMapMarker.swift */; }; /* End PBXBuildFile section */ @@ -73,6 +144,69 @@ remoteGlobalIDString = 3D9C428F22745894000A6585; remoteInfo = "MapirServices-iOS"; }; + C004681122E5DDD100CF922E /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3D9C428722745894000A6585 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C004680622E5DDD000CF922E; + remoteInfo = "MapirServices-macOS"; + }; + C056046222E6ED01004A2F9C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C056045822E6ED01004A2F9C /* Polyline.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 207F63FE19B5DF7E005261FA; + remoteInfo = Polyline; + }; + C056046422E6ED01004A2F9C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C056045822E6ED01004A2F9C /* Polyline.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 207F640919B5DF7E005261FA; + remoteInfo = PolylineTests; + }; + C056046622E6ED01004A2F9C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C056045822E6ED01004A2F9C /* Polyline.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 91F7832C1CE4EB7E004E87E3; + remoteInfo = PolylineMac; + }; + C056046822E6ED01004A2F9C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C056045822E6ED01004A2F9C /* Polyline.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 91F783351CE4EB7E004E87E3; + remoteInfo = PolylineMacTests; + }; + C056046A22E6ED01004A2F9C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C056045822E6ED01004A2F9C /* Polyline.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = DA1A10711D003E88009F82FA; + remoteInfo = PolylineTV; + }; + C056046C22E6ED01004A2F9C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C056045822E6ED01004A2F9C /* Polyline.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = DA1A107A1D003E88009F82FA; + remoteInfo = PolylineTVTests; + }; + C056046E22E6ED01004A2F9C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = C056045822E6ED01004A2F9C /* Polyline.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = DA1A10911D00400D009F82FA; + remoteInfo = PolylineWatch; + }; + C05604AA22E7204F004A2F9C /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 3D9C428722745894000A6585 /* Project object */; + proxyType = 1; + remoteGlobalIDString = C056049F22E7204F004A2F9C; + remoteInfo = "MapirServices-tvOS"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -87,13 +221,46 @@ name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; + C004682122E5DE6A00CF922E /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + C056048B22E709C3004A2F9C /* Polyline.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + C056052122E739D5004A2F9C /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + C056052022E739D5004A2F9C /* Polyline.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; + C056052422E739D9004A2F9C /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + C056052322E739D9004A2F9C /* Polyline.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; C0D3D3B922DF0687005419F3 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C0D3D3B822DF0687005419F3 /* Polyline.framework in Embed Frameworks */, + C056047122E6ED0B004A2F9C /* Polyline.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -128,6 +295,9 @@ 3D9C432A2274629C000A6585 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 3D9C432D2274629C000A6585 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 3D9C432F2274629C000A6585 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + C004680722E5DDD000CF922E /* MapirServices_macOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices_macOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C004680922E5DDD000CF922E /* MapirServices.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MapirServices.h; sourceTree = ""; }; + C004680F22E5DDD000CF922E /* MapirServices-macOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "MapirServices-macOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; C02DCF6422CA1C9600BA403F /* MPSWaypoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSWaypoint.swift; sourceTree = ""; }; C02DCF6622CA1CE700BA403F /* MPSStep.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSStep.swift; sourceTree = ""; }; C02DCF6822CA1DC300BA403F /* MPSLeg.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSLeg.swift; sourceTree = ""; }; @@ -137,24 +307,26 @@ C04CF65E22A25E5D009761C4 /* MPSReverseGeocode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSReverseGeocode.swift; sourceTree = ""; }; C04CF66522A270A0009761C4 /* MapirServicesPlayground.playground */ = {isa = PBXFileReference; lastKnownFileType = file.playground; path = MapirServicesPlayground.playground; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.swift; }; C04CF66822A27D6E009761C4 /* HTTPMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPMethod.swift; sourceTree = ""; }; - C051A23322DC53AB00E71703 /* Polyline.o */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.objfile"; name = Polyline.o; path = "../../../Library/Developer/Xcode/DerivedData/MapirServices-efxaoylofksjkvffeetggywahzqs/Build/Products/Debug-iphoneos/Polyline.o"; sourceTree = ""; }; + C056045822E6ED01004A2F9C /* Polyline.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Polyline.xcodeproj; path = Carthage/Checkouts/Polyline/Polyline.xcodeproj; sourceTree = ""; }; + C056049322E72014004A2F9C /* MapirServices_watchOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices_watchOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C05604A022E7204F004A2F9C /* MapirServices_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C05604A822E7204F004A2F9C /* MapirServices-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "MapirServices-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; C0706DBB22DEEBCE0038630E /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = SOURCE_ROOT; }; C086ACFA22C34F6F004256EA /* MPSLocationCoordinate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MPSLocationCoordinate.swift; sourceTree = ""; }; C08DB44C22CB302600FAE64A /* MPSLane.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSLane.swift; sourceTree = ""; }; C08DB44E22CB570800FAE64A /* MPSRoute.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSRoute.swift; sourceTree = ""; }; C08DB45922CC87E400FAE64A /* CLLocationCoordinate2D+initFromArray.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "CLLocationCoordinate2D+initFromArray.swift"; sourceTree = ""; }; C09704E822C363A000E2585C /* MPSFastReverseGeocode.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSFastReverseGeocode.swift; sourceTree = ""; }; - C0B79B2122D361BB005E9C24 /* MPSRouteObject.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSRouteObject.swift; sourceTree = ""; }; - C0D3D3B622DF0687005419F3 /* Polyline.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Polyline.framework; path = Carthage/Build/iOS/Polyline.framework; sourceTree = ""; }; - C0D3D3BA22DF1007005419F3 /* Cartfile.resolved */ = {isa = PBXFileReference; lastKnownFileType = file; path = Cartfile.resolved; sourceTree = SOURCE_ROOT; }; + C0B79B2122D361BB005E9C24 /* MPSRouteResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSRouteResult.swift; sourceTree = ""; }; + C0D3D3BA22DF1007005419F3 /* Cartfile.resolved */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile.resolved; sourceTree = SOURCE_ROOT; }; C0EA4F9322C89A8200BC04EF /* MPSDistance.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MPSDistance.swift; sourceTree = ""; }; C0EA4F9422C89A8200BC04EF /* MPSDuration.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MPSDuration.swift; sourceTree = ""; }; C0EA4F9522C89A8200BC04EF /* MPSDistanceMatrix.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MPSDistanceMatrix.swift; sourceTree = ""; }; C0EA4F9622C89A8200BC04EF /* MPSLocation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MPSLocation.swift; sourceTree = ""; }; C0EA4FDE22C9EBC800BC04EF /* MPSSearch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSSearch.swift; sourceTree = ""; }; C0EA4FE022C9EE2600BC04EF /* MPSSearchResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSSearchResult.swift; sourceTree = ""; }; - C0EA4FE222CA002600BC04EF /* MPSAutocompleteSearchResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSAutocompleteSearchResult.swift; sourceTree = ""; }; - C0EA4FE422CA003400BC04EF /* MPSAutocompleteSearch.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSAutocompleteSearch.swift; sourceTree = ""; }; + C0EA4FE222CA002600BC04EF /* MPSAutocompleteResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSAutocompleteResult.swift; sourceTree = ""; }; + C0EA4FE422CA003400BC04EF /* MPSAutocomplete.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSAutocomplete.swift; sourceTree = ""; }; C0FBFA2722D2009400A03FCC /* MPSStaticMapMarker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSStaticMapMarker.swift; sourceTree = ""; }; /* End PBXFileReference section */ @@ -163,7 +335,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C0D3D3B722DF0687005419F3 /* Polyline.framework in Frameworks */, + C056047022E6ED0B004A2F9C /* Polyline.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -183,6 +355,46 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C004680422E5DDD000CF922E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C056048A22E709C3004A2F9C /* Polyline.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C004680C22E5DDD000CF922E /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C004681022E5DDD100CF922E /* MapirServices_macOS.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056049022E72014004A2F9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C056051F22E739D5004A2F9C /* Polyline.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056049D22E7204F004A2F9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C056052222E739D9004A2F9C /* Polyline.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C05604A522E7204F004A2F9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C05604A922E7204F004A2F9C /* MapirServices_tvOS.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -210,6 +422,11 @@ 3D9C43012274611B000A6585 /* MapirServices-tvOSTests.xctest */, 3D9C431122746198000A6585 /* MapirServices-macOSTests.xctest */, 3D9C43212274629B000A6585 /* Example.app */, + C004680722E5DDD000CF922E /* MapirServices_macOS.framework */, + C004680F22E5DDD000CF922E /* MapirServices-macOSTests.xctest */, + C056049322E72014004A2F9C /* MapirServices_watchOS.framework */, + C05604A022E7204F004A2F9C /* MapirServices_tvOS.framework */, + C05604A822E7204F004A2F9C /* MapirServices-tvOSTests.xctest */, ); name = Products; sourceTree = ""; @@ -237,6 +454,7 @@ 3D9C42A0227458FA000A6585 /* Sources */ = { isa = PBXGroup; children = ( + C004680922E5DDD000CF922E /* MapirServices.h */, 3D9C42A122745900000A6585 /* MapirServices.swift */, C04CF66722A27D57009761C4 /* Core */, C04CF65D22A25E1E009761C4 /* Models */, @@ -286,8 +504,8 @@ C0EA4F9622C89A8200BC04EF /* MPSLocation.swift */, C0EA4FDE22C9EBC800BC04EF /* MPSSearch.swift */, C0EA4FE022C9EE2600BC04EF /* MPSSearchResult.swift */, - C0EA4FE222CA002600BC04EF /* MPSAutocompleteSearchResult.swift */, - C0EA4FE422CA003400BC04EF /* MPSAutocompleteSearch.swift */, + C0EA4FE222CA002600BC04EF /* MPSAutocompleteResult.swift */, + C0EA4FE422CA003400BC04EF /* MPSAutocomplete.swift */, C0FBFA2722D2009400A03FCC /* MPSStaticMapMarker.swift */, C08DB45022CB59FD00FAE64A /* Routing */, ); @@ -306,12 +524,25 @@ C051A23222DC53AA00E71703 /* Frameworks */ = { isa = PBXGroup; children = ( - C0D3D3B622DF0687005419F3 /* Polyline.framework */, - C051A23322DC53AB00E71703 /* Polyline.o */, + C056045822E6ED01004A2F9C /* Polyline.xcodeproj */, ); name = Frameworks; sourceTree = ""; }; + C056045922E6ED01004A2F9C /* Products */ = { + isa = PBXGroup; + children = ( + C056046322E6ED01004A2F9C /* Polyline.framework */, + C056046522E6ED01004A2F9C /* PolylineTests.xctest */, + C056046722E6ED01004A2F9C /* Polyline.framework */, + C056046922E6ED01004A2F9C /* PolylineTests.xctest */, + C056046B22E6ED01004A2F9C /* Polyline.framework */, + C056046D22E6ED01004A2F9C /* PolylineTests.xctest */, + C056046F22E6ED01004A2F9C /* Polyline.framework */, + ); + name = Products; + sourceTree = ""; + }; C086ACF522C34A45004256EA /* Extensions */ = { isa = PBXGroup; children = ( @@ -330,7 +561,7 @@ C02DCF6C22CA213B00BA403F /* MPSIntersection.swift */, C08DB44C22CB302600FAE64A /* MPSLane.swift */, C08DB44E22CB570800FAE64A /* MPSRoute.swift */, - C0B79B2122D361BB005E9C24 /* MPSRouteObject.swift */, + C0B79B2122D361BB005E9C24 /* MPSRouteResult.swift */, ); path = Routing; sourceTree = ""; @@ -342,6 +573,31 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + C0FA897122E899A4003EB4E3 /* MapirServices.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C004680222E5DDD000CF922E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C05604F722E737D2004A2F9C /* MapirServices.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056048E22E72014004A2F9C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C0FA897022E899A4003EB4E3 /* MapirServices.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056049B22E7204F004A2F9C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C0FA896822E899A3003EB4E3 /* MapirServices.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -406,6 +662,99 @@ productReference = 3D9C43212274629B000A6585 /* Example.app */; productType = "com.apple.product-type.application"; }; + C004680622E5DDD000CF922E /* MapirServices-macOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C004681C22E5DDD100CF922E /* Build configuration list for PBXNativeTarget "MapirServices-macOS" */; + buildPhases = ( + C004680222E5DDD000CF922E /* Headers */, + C004680322E5DDD000CF922E /* Sources */, + C004680422E5DDD000CF922E /* Frameworks */, + C004680522E5DDD000CF922E /* Resources */, + C004682122E5DE6A00CF922E /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "MapirServices-macOS"; + productName = "MapirServices-macOS"; + productReference = C004680722E5DDD000CF922E /* MapirServices_macOS.framework */; + productType = "com.apple.product-type.framework"; + }; + C004680E22E5DDD000CF922E /* MapirServices-macOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = C004681D22E5DDD100CF922E /* Build configuration list for PBXNativeTarget "MapirServices-macOSTests" */; + buildPhases = ( + C004680B22E5DDD000CF922E /* Sources */, + C004680C22E5DDD000CF922E /* Frameworks */, + C004680D22E5DDD000CF922E /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C004681222E5DDD100CF922E /* PBXTargetDependency */, + ); + name = "MapirServices-macOSTests"; + productName = "MapirServices-macOSTests"; + productReference = C004680F22E5DDD000CF922E /* MapirServices-macOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + C056049222E72014004A2F9C /* MapirServices-watchOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C056049822E72014004A2F9C /* Build configuration list for PBXNativeTarget "MapirServices-watchOS" */; + buildPhases = ( + C056048E22E72014004A2F9C /* Headers */, + C056048F22E72014004A2F9C /* Sources */, + C056049022E72014004A2F9C /* Frameworks */, + C056049122E72014004A2F9C /* Resources */, + C056052122E739D5004A2F9C /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "MapirServices-watchOS"; + productName = "MapirServices-watchOS"; + productReference = C056049322E72014004A2F9C /* MapirServices_watchOS.framework */; + productType = "com.apple.product-type.framework"; + }; + C056049F22E7204F004A2F9C /* MapirServices-tvOS */ = { + isa = PBXNativeTarget; + buildConfigurationList = C05604B122E7204F004A2F9C /* Build configuration list for PBXNativeTarget "MapirServices-tvOS" */; + buildPhases = ( + C056049B22E7204F004A2F9C /* Headers */, + C056049C22E7204F004A2F9C /* Sources */, + C056049D22E7204F004A2F9C /* Frameworks */, + C056049E22E7204F004A2F9C /* Resources */, + C056052422E739D9004A2F9C /* Embed Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = "MapirServices-tvOS"; + productName = "MapirServices-tvOS"; + productReference = C05604A022E7204F004A2F9C /* MapirServices_tvOS.framework */; + productType = "com.apple.product-type.framework"; + }; + C05604A722E7204F004A2F9C /* MapirServices-tvOSTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = C05604B422E7204F004A2F9C /* Build configuration list for PBXNativeTarget "MapirServices-tvOSTests" */; + buildPhases = ( + C05604A422E7204F004A2F9C /* Sources */, + C05604A522E7204F004A2F9C /* Frameworks */, + C05604A622E7204F004A2F9C /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + C05604AB22E7204F004A2F9C /* PBXTargetDependency */, + ); + name = "MapirServices-tvOSTests"; + productName = "MapirServices-tvOSTests"; + productReference = C05604A822E7204F004A2F9C /* MapirServices-tvOSTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -413,7 +762,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = ""; - LastSwiftUpdateCheck = 1020; + LastSwiftUpdateCheck = 1100; LastUpgradeCheck = 1020; ORGANIZATIONNAME = Map; TargetAttributes = { @@ -427,7 +776,19 @@ 3D9C43202274629B000A6585 = { CreatedOnToolsVersion = 10.2.1; }; - C035B3EE22DB4F340083BBD4 = { + C004680622E5DDD000CF922E = { + CreatedOnToolsVersion = 11.0; + }; + C004680E22E5DDD000CF922E = { + CreatedOnToolsVersion = 11.0; + }; + C056049222E72014004A2F9C = { + CreatedOnToolsVersion = 11.0; + }; + C056049F22E7204F004A2F9C = { + CreatedOnToolsVersion = 11.0; + }; + C05604A722E7204F004A2F9C = { CreatedOnToolsVersion = 11.0; }; }; @@ -445,16 +806,78 @@ ); productRefGroup = 3D9C429122745894000A6585 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = C056045922E6ED01004A2F9C /* Products */; + ProjectRef = C056045822E6ED01004A2F9C /* Polyline.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 3D9C428F22745894000A6585 /* MapirServices-iOS */, + C056049222E72014004A2F9C /* MapirServices-watchOS */, + C004680622E5DDD000CF922E /* MapirServices-macOS */, + C056049F22E7204F004A2F9C /* MapirServices-tvOS */, 3D9C42F02274604A000A6585 /* MapirServices-iOSTests */, + C004680E22E5DDD000CF922E /* MapirServices-macOSTests */, + C05604A722E7204F004A2F9C /* MapirServices-tvOSTests */, 3D9C43202274629B000A6585 /* Example */, - C035B3EE22DB4F340083BBD4 /* UniversalBinary */, ); }; /* End PBXProject section */ +/* Begin PBXReferenceProxy section */ + C056046322E6ED01004A2F9C /* Polyline.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Polyline.framework; + remoteRef = C056046222E6ED01004A2F9C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C056046522E6ED01004A2F9C /* PolylineTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = PolylineTests.xctest; + remoteRef = C056046422E6ED01004A2F9C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C056046722E6ED01004A2F9C /* Polyline.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Polyline.framework; + remoteRef = C056046622E6ED01004A2F9C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C056046922E6ED01004A2F9C /* PolylineTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = PolylineTests.xctest; + remoteRef = C056046822E6ED01004A2F9C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C056046B22E6ED01004A2F9C /* Polyline.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Polyline.framework; + remoteRef = C056046A22E6ED01004A2F9C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C056046D22E6ED01004A2F9C /* PolylineTests.xctest */ = { + isa = PBXReferenceProxy; + fileType = wrapper.cfbundle; + path = PolylineTests.xctest; + remoteRef = C056046C22E6ED01004A2F9C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + C056046F22E6ED01004A2F9C /* Polyline.framework */ = { + isa = PBXReferenceProxy; + fileType = wrapper.framework; + path = Polyline.framework; + remoteRef = C056046E22E6ED01004A2F9C /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; +/* End PBXReferenceProxy section */ + /* Begin PBXResourcesBuildPhase section */ 3D9C428E22745894000A6585 /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -479,46 +902,42 @@ ); runOnlyForDeploymentPostprocessing = 0; }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - C035B3F222DB4F530083BBD4 /* Build Process */ = { - isa = PBXShellScriptBuildPhase; + C004680522E5DDD000CF922E /* Resources */ = { + isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = "Build Process"; - outputFileListPaths = ( - ); - outputPaths = ( - ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "# Set bash script to exit immediately if any commands fail.\nset -e\n\nUNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal\n\n# make sure the output directory exists\nmkdir -p \"${UNIVERSAL_OUTPUTFOLDER}\"\n\n# Step 0. If your SDK's target name is different from project name, edit the target name below.\nTARGET_TO_BUILD=${PROJECT_NAME}-iOS\n\n# Step 1. Build Device and Simulator versions\nxcodebuild -target \"${TARGET_TO_BUILD}\" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\nxcodebuild -target \"${TARGET_TO_BUILD}\" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR=\"${BUILD_DIR}\" BUILD_ROOT=\"${BUILD_ROOT}\" clean build\n\n# Step 2. Copy the framework structure (from iphoneos build) to the universal folder\ncp -R \"${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework\" \"${UNIVERSAL_OUTPUTFOLDER}/\"\n\n# Step 3. Copy Swift modules from iphonesimulator build (if it exists) to the copied framework directory\nSIMULATOR_SWIFT_MODULES_DIR=\"${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule/.\"\nif [ -d \"${SIMULATOR_SWIFT_MODULES_DIR}\" ]; then\ncp -R \"${SIMULATOR_SWIFT_MODULES_DIR}\" \"${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/Modules/${PROJECT_NAME}.swiftmodule\"\nfi\n\n# Step 4. Create universal binary file using lipo and place the combined executable in the copied framework directory\nlipo -create -output \"${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework/${PROJECT_NAME}\" \"${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${PROJECT_NAME}.framework/${PROJECT_NAME}\" \"${BUILD_DIR}/${CONFIGURATION}-iphoneos/${PROJECT_NAME}.framework/${PROJECT_NAME}\"\n\n# Step 5. Specify the exact output as you wish. check for existance of the folder\nFINAL_OUTPUTFOLDER=${PROJECT_DIR}/build\nmkdir -p \"${FINAL_OUTPUTFOLDER}\"\n\n# Step 6. Convenience step to copy the framework to the project's directory\ncp -R \"${UNIVERSAL_OUTPUTFOLDER}/${PROJECT_NAME}.framework\" \"${FINAL_OUTPUTFOLDER}\"\n\n# Step 7. Convenience step to open the project's directory in Finder\n# open \"${FINAL_OUTPUTFOLDER}\"\n"; }; - C035B3F322DB93820083BBD4 /* SwiftLint */ = { - isa = PBXShellScriptBuildPhase; + C004680D22E5DDD000CF922E /* Resources */ = { + isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); - inputPaths = ( + runOnlyForDeploymentPostprocessing = 0; + }; + C056049122E72014004A2F9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( ); - name = SwiftLint; - outputFileListPaths = ( + runOnlyForDeploymentPostprocessing = 0; + }; + C056049E22E7204F004A2F9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( ); - outputPaths = ( + runOnlyForDeploymentPostprocessing = 0; + }; + C05604A622E7204F004A2F9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( ); runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "if which swiftlint >/dev/null; then\nswiftlint\nelse\necho \"warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint\"\nfi\n"; }; -/* End PBXShellScriptBuildPhase section */ +/* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ 3D9C428C22745894000A6585 /* Sources */ = { @@ -528,9 +947,9 @@ C08DB44D22CB302600FAE64A /* MPSLane.swift in Sources */, C02DCF6D22CA213B00BA403F /* MPSIntersection.swift in Sources */, C0EA4F9922C89A8300BC04EF /* MPSDistanceMatrix.swift in Sources */, - C0EA4FE522CA003400BC04EF /* MPSAutocompleteSearch.swift in Sources */, + C0EA4FE522CA003400BC04EF /* MPSAutocomplete.swift in Sources */, C08DB44F22CB570800FAE64A /* MPSRoute.swift in Sources */, - C0EA4FE322CA002600BC04EF /* MPSAutocompleteSearchResult.swift in Sources */, + C0EA4FE322CA002600BC04EF /* MPSAutocompleteResult.swift in Sources */, C02DCF6B22CA213000BA403F /* MPSManeuver.swift in Sources */, 3D9C42A222745900000A6585 /* MapirServices.swift in Sources */, C0FBFA2822D2009400A03FCC /* MPSStaticMapMarker.swift in Sources */, @@ -538,7 +957,7 @@ C02E70E122B11B6D0058BCA7 /* MPSError.swift in Sources */, C0EA4F9722C89A8300BC04EF /* MPSDistance.swift in Sources */, C02DCF6922CA1DC300BA403F /* MPSLeg.swift in Sources */, - C0B79B2222D361BC005E9C24 /* MPSRouteObject.swift in Sources */, + C0B79B2222D361BC005E9C24 /* MPSRouteResult.swift in Sources */, C09704E922C363A000E2585C /* MPSFastReverseGeocode.swift in Sources */, C04CF66922A27D6E009761C4 /* HTTPMethod.swift in Sources */, C02DCF6522CA1C9600BA403F /* MPSWaypoint.swift in Sources */, @@ -569,6 +988,115 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C004680322E5DDD000CF922E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C056047322E70993004A2F9C /* MPSReverseGeocode.swift in Sources */, + C056048822E709A2004A2F9C /* MPSRouteResult.swift in Sources */, + C056048222E709A2004A2F9C /* MPSLeg.swift in Sources */, + C056047222E7098D004A2F9C /* MapirServices.swift in Sources */, + C056047F22E7099B004A2F9C /* HTTPMethod.swift in Sources */, + C056048922E709A8004A2F9C /* CLLocationCoordinate2D+initFromArray.swift in Sources */, + C056048322E709A2004A2F9C /* MPSStep.swift in Sources */, + C056048422E709A2004A2F9C /* MPSManeuver.swift in Sources */, + C056048722E709A2004A2F9C /* MPSRoute.swift in Sources */, + C056047622E70993004A2F9C /* MPSDistance.swift in Sources */, + C056047422E70993004A2F9C /* MPSFastReverseGeocode.swift in Sources */, + C056047722E70993004A2F9C /* MPSDistanceMatrix.swift in Sources */, + C056047922E70993004A2F9C /* MPSLocation.swift in Sources */, + C056048122E709A2004A2F9C /* MPSWaypoint.swift in Sources */, + C056048522E709A2004A2F9C /* MPSIntersection.swift in Sources */, + C056047D22E70993004A2F9C /* MPSAutocomplete.swift in Sources */, + C056047822E70993004A2F9C /* MPSDuration.swift in Sources */, + C056047B22E70993004A2F9C /* MPSSearchResult.swift in Sources */, + C056048022E7099B004A2F9C /* MPSError.swift in Sources */, + C056047E22E70993004A2F9C /* MPSStaticMapMarker.swift in Sources */, + C056047522E70993004A2F9C /* MPSLocationCoordinate.swift in Sources */, + C056048622E709A2004A2F9C /* MPSLane.swift in Sources */, + C056047C22E70993004A2F9C /* MPSAutocompleteResult.swift in Sources */, + C056047A22E70993004A2F9C /* MPSSearch.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C004680B22E5DDD000CF922E /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C056048D22E71B35004A2F9C /* MapirServicesTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056048F22E72014004A2F9C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C05604E322E737B7004A2F9C /* MPSFastReverseGeocode.swift in Sources */, + C05604F522E737B7004A2F9C /* MPSRouteResult.swift in Sources */, + C05604EF22E737B7004A2F9C /* MPSLeg.swift in Sources */, + C05604E922E737B7004A2F9C /* MPSSearch.swift in Sources */, + C05604E822E737B7004A2F9C /* MPSLocation.swift in Sources */, + C05604F622E737B7004A2F9C /* CLLocationCoordinate2D+initFromArray.swift in Sources */, + C05604F022E737B7004A2F9C /* MPSStep.swift in Sources */, + C05604F122E737B7004A2F9C /* MPSManeuver.swift in Sources */, + C05604F422E737B7004A2F9C /* MPSRoute.swift in Sources */, + C05604E722E737B7004A2F9C /* MPSDuration.swift in Sources */, + C05604ED22E737B7004A2F9C /* MPSStaticMapMarker.swift in Sources */, + C05604EC22E737B7004A2F9C /* MPSAutocomplete.swift in Sources */, + C05604E222E737B7004A2F9C /* MPSReverseGeocode.swift in Sources */, + C05604EE22E737B7004A2F9C /* MPSWaypoint.swift in Sources */, + C05604F222E737B7004A2F9C /* MPSIntersection.swift in Sources */, + C05604E622E737B7004A2F9C /* MPSDistanceMatrix.swift in Sources */, + C05604E022E737B7004A2F9C /* HTTPMethod.swift in Sources */, + C05604E422E737B7004A2F9C /* MPSLocationCoordinate.swift in Sources */, + C05604E122E737B7004A2F9C /* MPSError.swift in Sources */, + C05604EA22E737B7004A2F9C /* MPSSearchResult.swift in Sources */, + C05604E522E737B7004A2F9C /* MPSDistance.swift in Sources */, + C05604F322E737B7004A2F9C /* MPSLane.swift in Sources */, + C05604EB22E737B7004A2F9C /* MPSAutocompleteResult.swift in Sources */, + C05604DF22E737B7004A2F9C /* MapirServices.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056049C22E7204F004A2F9C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C05604C122E737B6004A2F9C /* MPSFastReverseGeocode.swift in Sources */, + C05604D322E737B6004A2F9C /* MPSRouteResult.swift in Sources */, + C05604CD22E737B6004A2F9C /* MPSLeg.swift in Sources */, + C05604C722E737B6004A2F9C /* MPSSearch.swift in Sources */, + C05604C622E737B6004A2F9C /* MPSLocation.swift in Sources */, + C05604D422E737B6004A2F9C /* CLLocationCoordinate2D+initFromArray.swift in Sources */, + C05604CE22E737B6004A2F9C /* MPSStep.swift in Sources */, + C05604CF22E737B6004A2F9C /* MPSManeuver.swift in Sources */, + C05604D222E737B6004A2F9C /* MPSRoute.swift in Sources */, + C05604C522E737B6004A2F9C /* MPSDuration.swift in Sources */, + C05604CB22E737B6004A2F9C /* MPSStaticMapMarker.swift in Sources */, + C05604CA22E737B6004A2F9C /* MPSAutocomplete.swift in Sources */, + C05604C022E737B6004A2F9C /* MPSReverseGeocode.swift in Sources */, + C05604CC22E737B6004A2F9C /* MPSWaypoint.swift in Sources */, + C05604D022E737B6004A2F9C /* MPSIntersection.swift in Sources */, + C05604C422E737B6004A2F9C /* MPSDistanceMatrix.swift in Sources */, + C05604BE22E737B6004A2F9C /* HTTPMethod.swift in Sources */, + C05604C222E737B6004A2F9C /* MPSLocationCoordinate.swift in Sources */, + C05604BF22E737B6004A2F9C /* MPSError.swift in Sources */, + C05604C822E737B6004A2F9C /* MPSSearchResult.swift in Sources */, + C05604C322E737B6004A2F9C /* MPSDistance.swift in Sources */, + C05604D122E737B6004A2F9C /* MPSLane.swift in Sources */, + C05604C922E737B6004A2F9C /* MPSAutocompleteResult.swift in Sources */, + C05604BD22E737B6004A2F9C /* MapirServices.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C05604A422E7204F004A2F9C /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + C05604F822E737DA004A2F9C /* MapirServicesTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -582,6 +1110,16 @@ target = 3D9C428F22745894000A6585 /* MapirServices-iOS */; targetProxy = 3D9C433622746323000A6585 /* PBXContainerItemProxy */; }; + C004681222E5DDD100CF922E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C004680622E5DDD000CF922E /* MapirServices-macOS */; + targetProxy = C004681122E5DDD100CF922E /* PBXContainerItemProxy */; + }; + C05604AB22E7204F004A2F9C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C056049F22E7204F004A2F9C /* MapirServices-tvOS */; + targetProxy = C05604AA22E7204F004A2F9C /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -648,7 +1186,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; @@ -707,7 +1245,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; @@ -738,14 +1276,14 @@ ); INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 0.1.0; - PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.services-iOS"; + MARKETING_VERSION = 0.2.0; + PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.MapirServices-iOS"; PRODUCT_NAME = MapirServices; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; @@ -773,14 +1311,14 @@ ); INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 0.1.0; - PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.services-iOS"; + MARKETING_VERSION = 0.2.0; + PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.MapirServices-iOS"; PRODUCT_NAME = MapirServices; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; @@ -793,7 +1331,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = Configs/MapirServicesTests.plist; + INFOPLIST_FILE = "Configs/MapirServicesTests-iOS.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -811,7 +1349,7 @@ isa = XCBuildConfiguration; buildSettings = { CODE_SIGN_STYLE = Automatic; - INFOPLIST_FILE = Configs/MapirServicesTests.plist; + INFOPLIST_FILE = "Configs/MapirServicesTests-iOS.plist"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -839,7 +1377,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.1.0; + MARKETING_VERSION = 0.2.0; PRODUCT_BUNDLE_IDENTIFIER = ir.map.MapirServicesExample; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -862,7 +1400,7 @@ "$(inherited)", "@executable_path/Frameworks", ); - MARKETING_VERSION = 0.1.0; + MARKETING_VERSION = 0.2.0; PRODUCT_BUNDLE_IDENTIFIER = ir.map.MapirServicesExample; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -871,21 +1409,265 @@ }; name = Release; }; - C035B3EF22DB4F350083BBD4 /* Debug */ = { + C004681822E5DDD100CF922E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Configs/MapirServices.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 0.2.0; + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-macOS"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + C004681922E5DDD100CF922E /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/Carthage/Build/iOS", + ); + FRAMEWORK_VERSION = A; + INFOPLIST_FILE = Configs/MapirServices.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 0.2.0; + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-macOS"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + C004681A22E5DDD100CF922E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = 33DVPZ7L7T; + INFOPLIST_FILE = "Configs/MapirServicesTests-macOS.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-macOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_VERSION = 5.0; }; name = Debug; }; - C035B3F022DB4F350083BBD4 /* Release */ = { + C004681B22E5DDD100CF922E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; CODE_SIGN_STYLE = Automatic; + COMBINE_HIDPI_IMAGES = YES; DEVELOPMENT_TEAM = 33DVPZ7L7T; + INFOPLIST_FILE = "Configs/MapirServicesTests-macOS.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/../Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.14; + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-macOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + C056049922E72014004A2F9C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 33DVPZ7L7T; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/MapirServices.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 0.2.0; + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-watchOS"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Debug; + }; + C056049A22E72014004A2F9C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 33DVPZ7L7T; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/MapirServices.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 0.2.0; + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-watchOS"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = watchos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 4; + WATCHOS_DEPLOYMENT_TARGET = 3.0; + }; + name = Release; + }; + C05604B222E7204F004A2F9C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 33DVPZ7L7T; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/MapirServices.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 0.2.0; + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Debug; + }; + C05604B322E7204F004A2F9C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = 33DVPZ7L7T; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = Configs/MapirServices.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MARKETING_VERSION = 0.2.0; + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-tvOS"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SDKROOT = appletvos; + SKIP_INSTALL = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 9.0; + }; + name = Release; + }; + C05604B522E7204F004A2F9C /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 33DVPZ7L7T; + INFOPLIST_FILE = "MapirServices-tvOSTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-tvOSTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 13.0; + }; + name = Debug; + }; + C05604B622E7204F004A2F9C /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = 33DVPZ7L7T; + INFOPLIST_FILE = "MapirServices-tvOSTests/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-tvOSTests"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = appletvos; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = 3; + TVOS_DEPLOYMENT_TARGET = 13.0; }; name = Release; }; @@ -928,11 +1710,47 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C035B3F122DB4F350083BBD4 /* Build configuration list for PBXAggregateTarget "UniversalBinary" */ = { + C004681C22E5DDD100CF922E /* Build configuration list for PBXNativeTarget "MapirServices-macOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C004681822E5DDD100CF922E /* Debug */, + C004681922E5DDD100CF922E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C004681D22E5DDD100CF922E /* Build configuration list for PBXNativeTarget "MapirServices-macOSTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C004681A22E5DDD100CF922E /* Debug */, + C004681B22E5DDD100CF922E /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C056049822E72014004A2F9C /* Build configuration list for PBXNativeTarget "MapirServices-watchOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C056049922E72014004A2F9C /* Debug */, + C056049A22E72014004A2F9C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C05604B122E7204F004A2F9C /* Build configuration list for PBXNativeTarget "MapirServices-tvOS" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C05604B222E7204F004A2F9C /* Debug */, + C05604B322E7204F004A2F9C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C05604B422E7204F004A2F9C /* Build configuration list for PBXNativeTarget "MapirServices-tvOSTests" */ = { isa = XCConfigurationList; buildConfigurations = ( - C035B3EF22DB4F350083BBD4 /* Debug */, - C035B3F022DB4F350083BBD4 /* Release */, + C05604B522E7204F004A2F9C /* Debug */, + C05604B622E7204F004A2F9C /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-iOS.xcscheme b/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-iOS.xcscheme index afbe48e..22a546b 100644 --- a/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-iOS.xcscheme +++ b/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-iOS.xcscheme @@ -1,6 +1,6 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-tvOS.xcscheme b/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-tvOS.xcscheme new file mode 100644 index 0000000..ae3326c --- /dev/null +++ b/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-tvOS.xcscheme @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-watchOS.xcscheme b/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-watchOS.xcscheme new file mode 100644 index 0000000..1773931 --- /dev/null +++ b/MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-watchOS.xcscheme @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MapirServicesPlayground.playground/Contents.swift b/MapirServicesPlayground.playground/Contents.swift index 8fc159b..8b13789 100644 --- a/MapirServicesPlayground.playground/Contents.swift +++ b/MapirServicesPlayground.playground/Contents.swift @@ -1,31 +1 @@ -import UIKit -import Foundation -import MapirServices - -var str = "Hello, playground" - -typealias Parameter = [String: Any] - -let session = URLSession.shared - -let lat = 34.0 -let lng = 51.2 -let params: Parameter = ["lat" : lat, "lng" : lng] - -let url = URL(string: "https://map.ir/reverse?lat=\(params["lat"])&lon=\(params["lon"])") - -var request = URLRequest(url: url!) -request.httpMethod = "get" -request.timeoutInterval = 20 - -//extension URL { -// mutating func addParameters(params: [String : String]) { -// let randomElement = params.randomElement() -// self.appendingPathComponent("?\(randomElement?.key)=\(randomElement?.value)") -// for (key, value) in params { -// self.appendingPathComponent("&\(key)=\(value)") -// } -// } -//} - diff --git a/Sources/Core/MPSError.swift b/Sources/Core/MPSError.swift index 6aa543b..048e897 100644 --- a/Sources/Core/MPSError.swift +++ b/Sources/Core/MPSError.swift @@ -10,21 +10,39 @@ import Foundation public enum MPSError: Error { - case noAPIAccessToken + /// Errors related to the service. + enum ServiceError: Error { - case invalidResponse + /// Indicates token-related errors. + case invalidAccessToken - enum ServiceError: Error { + /// Error due to unavailability of services. case serviceUnavailabele } - enum RequestError: Error { + /// Response related errors. + enum ResponseError: Error { + + /// Response form is not valid + case invalidResponse + + /// HTTP 400: Bad Reuqest. case badRequest + + /// HTTP 404: Not Found. case notFound + } + + /// Request related errors. + enum RequestError: Error { + + /// Error due to invalid input arguments. case invalidArgument } + /// Error due to generating request URL case urlEncodingError + /// Error due to decoding image into UIImage case imageDecodingError } diff --git a/Sources/MapirServices.h b/Sources/MapirServices.h new file mode 100644 index 0000000..f50f0db --- /dev/null +++ b/Sources/MapirServices.h @@ -0,0 +1,18 @@ +// +// MapirServices.h +// MapirServices +// +// Created by Alireza Asadi on 31/4/1398 AP. +// Copyright © 1398 AP Map. All rights reserved. +// + +#import +#import + +//! Project version number for MapirServices. +FOUNDATION_EXPORT double MapirServicesVersionNumber; + +//! Project version string for MapirServices. +FOUNDATION_EXPORT const unsigned char MapirServicesVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import diff --git a/Sources/MapirServices.swift b/Sources/MapirServices.swift index 5759299..1aa5485 100644 --- a/Sources/MapirServices.swift +++ b/Sources/MapirServices.swift @@ -9,26 +9,33 @@ // Include Foundation @_exported import Foundation import CoreLocation + +#if os(iOS) || os(watchOS) || os(tvOS) import UIKit +#elseif os(macOS) +import AppKit +#endif public class MPSMapirServices { + /// Map.ir API endpoints. private struct Endpoint { static let reverseGeocode = "/reverse" static let fastReverseGeocode = "/fast-reverse" static let distanceMatrix = "/distancematrix" static let search = "/search" static let autocomleteSearch = "/search/autocomplete" - static func route(forType type: MPSRouteType) -> String { - return "/routes/\(type.rawValue)/v1/driving" + static func route(forMode mode: MPSRoute.Mode) -> String { + return "/routes/\(mode.rawValue)/v1/driving" } static let staticMap = "/static" } + /// Singleton object of MPSMapirServices public static let shared = MPSMapirServices() - let baseURL: URL! = URL(string: "https://map.ir") + let host: String = "map.ir" private var token: String? @@ -46,31 +53,95 @@ public class MPSMapirServices { } } - private func essentialRequest(withEndpoint endpoint: String, query: String?, httpMethod: String) throws -> URLRequest { - guard let url = URL(string: baseURL.absoluteString + endpoint + (query ?? "")) else { + private let userAgent: String = { + var components: [String] = [] + + if let appName = Bundle.main.infoDictionary?["CFBundleName"] as? String ?? Bundle.main.infoDictionary?["CFBundleIdentifier"] as? String { + let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "" + components.append("\(appName)/\(version)") + } + + let libraryBundle: Bundle? = Bundle(for: MPSMapirServices.self) + + if let libraryName = libraryBundle?.infoDictionary?["CFBundleName"] as? String, let version = libraryBundle?.infoDictionary?["CFBundleShortVersionString"] as? String { + components.append("\(libraryName)/\(version)") + } + + let system: String + #if os(OSX) + system = "macOS" + #elseif os(iOS) + system = "iOS" + #elseif os(watchOS) + system = "watchOS" + #elseif os(tvOS) + system = "tvOS" + #endif + let systemVersion = ProcessInfo().operatingSystemVersion + components.append("\(system)/\(systemVersion.majorVersion).\(systemVersion.minorVersion).\(systemVersion.patchVersion)") + + let chip: String + #if arch(x86_64) + chip = "x86_64" + #elseif arch(arm) + chip = "arm" + #elseif arch(arm64) + chip = "arm64" + #elseif arch(i386) + chip = "i386" + #endif + components.append("(\(chip))") + + return components.joined(separator: " ") + }() + + private func urlRequest(withPath path: String, + queryItems: [URLQueryItem]?, + httpMethod: String) throws -> URLRequest { + + var urlComponents = URLComponents() + urlComponents.scheme = "https" + urlComponents.host = self.host + urlComponents.path = path + urlComponents.queryItems = queryItems + + guard let url = urlComponents.url else { throw MPSError.urlEncodingError } + var request = URLRequest(url: url) request.timeoutInterval = 10 request.httpMethod = httpMethod + if let token = token { request.addValue(token, forHTTPHeaderField: "x-api-key") } else { - throw MPSError.noAPIAccessToken + throw MPSError.ServiceError.invalidAccessToken } request.addValue("application/json", forHTTPHeaderField: "Content-Type") + request.addValue(self.userAgent, forHTTPHeaderField: "User-Agent") return request } - public func getReverseGeocode(for point: CLLocationCoordinate2D, - completionHandler: @escaping (Result) -> Void) { - - let query: String = "?lat=\(point.latitude)&lon=\(point.longitude)" + /// Generates address of a location coordinate. + /// + /// - Parameter point: The input coordinates to find address for it. + /// - Parameter completionHandler: closure which gets called when result is recieved or and error occures. + /// - Parameter result: a `Result` of types `MPSReverseGeocode` if execution succeeds and `Error` if it fails. + /// + /// + /// This methods calls APIs to find address of a location based on its coordinates. + /// `completionHandler` gets called whenever execution finishes with success or error. + public func reverseGeocode(for point: CLLocationCoordinate2D, + completionHandler: @escaping (_ result: Result) -> Void) { + + let queryItems = [URLQueryItem(name: "lat", value: "\(point.latitude)"), + URLQueryItem(name: "lon", value: "\(point.longitude)")] let request: URLRequest do { - request = try essentialRequest(withEndpoint: Endpoint.reverseGeocode, query: query, httpMethod: HTTPMethod.get) + request = try urlRequest(withPath: Endpoint.reverseGeocode, queryItems: queryItems, httpMethod: HTTPMethod.get) } catch let requestError { completionHandler(.failure(requestError)) return @@ -82,7 +153,7 @@ public class MPSMapirServices { return } guard let urlResponse = urlResponse as? HTTPURLResponse else { - completionHandler(.failure(MPSError.invalidResponse)) + completionHandler(.failure(MPSError.ResponseError.invalidResponse)) return } @@ -99,9 +170,9 @@ public class MPSMapirServices { } } case 400: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.badRequest)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.badRequest)) } case 404: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.notFound)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.notFound)) } default: return } @@ -110,29 +181,37 @@ public class MPSMapirServices { dataTask.resume() } - public func getFastReverseGeocode(for point: CLLocationCoordinate2D, - completionHandler: @escaping (Result) -> Void) { + /// generates address of a location. It's faster than normal `reverseGeocode` method. + /// + /// - Parameter point: the coordinate of the location. + /// - Parameter completionHandler: Closure which is called when execution finishes either successfull or with error. + /// - Parameter result: a `Result` of types `MPSFastReverseGeocode` if execution succeeds and `Error` if it fails. + /// + /// this method is a faster way to access to the address of a location. result will be available about 50ms faster than usual with this method. + public func fastReverseGeocode(for point: CLLocationCoordinate2D, + completionHandler: @escaping (_ result: Result) -> Void) { - let query: String = "?lat=\(point.latitude)&lon=\(point.longitude)" + let queryItems = [URLQueryItem(name: "lat", value: "\(point.latitude)"), + URLQueryItem(name: "lon", value: "\(point.longitude)")] let request: URLRequest do { - request = try essentialRequest(withEndpoint: Endpoint.reverseGeocode, - query: query, + request = try urlRequest(withPath: Endpoint.reverseGeocode, + queryItems: queryItems, httpMethod: HTTPMethod.get) } catch let requestError { completionHandler(.failure(requestError)) return } - session.dataTask(with: request) { (data, urlResponse, error) in + let dataTask = session.dataTask(with: request) { (data, urlResponse, error) in if let error = error { DispatchQueue.main.async { completionHandler(.failure(error)) } return } guard let urlResponse = urlResponse as? HTTPURLResponse else { - completionHandler(.failure(MPSError.invalidResponse)) + completionHandler(.failure(MPSError.ResponseError.invalidResponse)) return } @@ -149,74 +228,82 @@ public class MPSMapirServices { } } case 400: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.badRequest)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.badRequest)) } return case 404: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.notFound)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.notFound)) } return default: return } - }.resume() + } - } + dataTask.resume() - public func getDistanceMatrix(from origins: [CLLocationCoordinate2D], - to destinations: [CLLocationCoordinate2D], - options: MPSDistanceMatrixOptions = [], - completionHandler: @escaping (Result) -> Void) { + } - var query: String = "?" - query += "origins=" + /// Generates a matrix of distance and duration between origins and destinations. + /// + /// - Parameter origins: Coordinates of origin. + /// - Parameter destinations: Coordinates of destinations. + /// - Parameter options: Options of matrix calculation. By default it's `nil`. + /// - Parameter result: a `Result` of types `MPSDistanceMatrix` if execution succeeds and `Error` if it fails. + /// + /// This method is used to find distance and duration between some origins and destinations. The result durations are in seconds and distances are in meters. + /// It's important to know that the result is calculated with consideration of traffic and land routes. + public func distanceMatrix(from origins: [CLLocationCoordinate2D], + to destinations: [CLLocationCoordinate2D], + options: MPSDistanceMatrix.Options = [], + completionHandler: @escaping (_ result: Result) -> Void) { + + var queryItems: [URLQueryItem] = [] + var vlaue = "" for origin in origins { let uuid = UUID() let uuidString = uuid.uuidString.replacingOccurrences(of: "-", with: "") - query += "\(uuidString),\(origin.latitude),\(origin.longitude)|" + vlaue += "\(uuidString),\(origin.latitude),\(origin.longitude)|" } - query.removeLast() - - query += "&destinations=" + vlaue.removeLast() + queryItems.append(URLQueryItem(name: "origins", value: vlaue)) + + vlaue = "" for destination in destinations { let uuid = UUID() let uuidString = uuid.uuidString.replacingOccurrences(of: "-", with: "") - query += "\(uuidString),\(destination.latitude),\(destination.longitude)|" + vlaue += "\(uuidString),\(destination.latitude),\(destination.longitude)|" } - query.removeLast() + vlaue.removeLast() + queryItems.append(URLQueryItem(name: "destinations", value: vlaue)) + if options.contains(.sorted) { - query += "&sorted=true" + queryItems.append(URLQueryItem(name: "sorted", value: "true")) } if !(options.contains(.distance) && options.contains(.duration)) { if options.contains(.distance) { - query += "&$filter=type eq distance" + queryItems.append(URLQueryItem(name: "$filter", value: "type eq distance")) + } if options.contains(.duration) { - query += "&$filter=type eq duration" + queryItems.append(URLQueryItem(name: "$filter", value: "type eq duration")) } } - guard let urlEncodedQuery = query.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { - completionHandler(.failure(MPSError.RequestError.invalidArgument)) - return - } - let request: URLRequest do { - request = try essentialRequest(withEndpoint: Endpoint.distanceMatrix, - query: urlEncodedQuery, - httpMethod: HTTPMethod.get) + request = try urlRequest(withPath: Endpoint.distanceMatrix, queryItems: queryItems, httpMethod: HTTPMethod.get) } catch let requestError { completionHandler(.failure(requestError)) return } - session.dataTask(with: request) { (data, urlResponse, error) in + let dataTask = session.dataTask(with: request) { (data, urlResponse, error) in if let error = error { DispatchQueue.main.async { completionHandler(.failure(error)) } return } guard let urlResponse = urlResponse as? HTTPURLResponse else { - completionHandler(.failure(MPSError.invalidResponse)) + completionHandler(.failure(MPSError.ResponseError.invalidResponse)) return } @@ -234,28 +321,40 @@ public class MPSMapirServices { } } case 400: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.badRequest)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.badRequest)) } return case 404: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.notFound)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.notFound)) } return default: return } - }.resume() + } + + dataTask.resume() } - public func getSearchResult(for text: String, - around location: CLLocationCoordinate2D, - selectionOptions: MPSSearchOptions = [], - filter: MPSSearchFilter? = nil, - completionHandler: @escaping (Result) -> Void) { + /// Searching around a location about a specific place. + /// + /// - Parameter text: the name or any data about the place. + /// - Parameter location: center of search. + /// - Parameter selectionOptions: type of places, e.g. Road, POI, city, etc. more selected options will result in more accurte search. + /// - Parameter filter: filters of search. e.g. places with distance less that specified meters. + /// - Parameter result: a `Result` of types array of `MPSSearchResult`s if execution succeeds and `Error` if it fails. + /// + /// Search will result in different kind of places. Text can even be an address which will result in a geocode result. + /// Using more accurate filters and options will result in more accurate results. Number of results will not be more than 16 results. + public func search(for text: String, + around location: CLLocationCoordinate2D, + selectionOptions: MPSSearchOptions = [], + filter: MPSSearchFilter? = nil, + completionHandler: @escaping (_ result: Result<[MPSSearchResult], Error>) -> Void) { var request: URLRequest do { - request = try essentialRequest(withEndpoint: Endpoint.search, - query: nil, - httpMethod: HTTPMethod.post) + request = try urlRequest(withPath: Endpoint.search, + queryItems: nil, + httpMethod: HTTPMethod.post) } catch let requestError { completionHandler(.failure(requestError)) return @@ -274,11 +373,11 @@ public class MPSMapirServices { return } - session.dataTask(with: request) { (data, urlResponse, error) in + let dataTask = session.dataTask(with: request) { (data, urlResponse, error) in if let error = error { DispatchQueue.main.async { completionHandler(.failure(error)) } } guard let urlResponse = urlResponse as? HTTPURLResponse else { - DispatchQueue.main.async { completionHandler(.failure(MPSError.invalidResponse)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.invalidResponse)) } return } @@ -287,7 +386,8 @@ public class MPSMapirServices { if let data = data { do { let decodedData = try self.decoder.decode(MPSSearch.self, from: data) - DispatchQueue.main.async { completionHandler(.success(decodedData)) } + let searchResults = decodedData.results + DispatchQueue.main.async { completionHandler(.success(searchResults)) } return } catch let parseError { DispatchQueue.main.async { completionHandler(.failure(parseError)) } @@ -295,29 +395,38 @@ public class MPSMapirServices { } } case 400: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.badRequest)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.badRequest)) } return case 404: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.notFound)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.notFound)) } return default: return } - }.resume() - } + } - public func getAutocompleteSearchResult(for text: String, - around location: CLLocationCoordinate2D, - selectionOptions: MPSSearchOptions = [], - filter: MPSSearchFilter? = nil, - completionHandler: @escaping (Result) -> Void) { + dataTask.resume() + } + /// Autocompletes for text around a location. + /// - Parameter text: Input text. + /// - Parameter location: Center of autocomplete search + /// - Parameter selectionOptions: type of places, e.g. Road, POI, city, etc. more selected options will result in more accurte search. + /// - Parameter filter: filters of search. e.g. places with distance less that specified meters. + /// - Parameter result: a `Result` of types array of `MPSAutocompleteResult`s if execution succeeds and `Error` if it fails. + /// + /// Using more accurate filters and options will result in more accurate results. Number of results will not be more than 16 results. + public func autocomplete(for text: String, + around location: CLLocationCoordinate2D, + selectionOptions: MPSSearchOptions = [], + filter: MPSSearchFilter? = nil, + completionHandler: @escaping (_ result: Result<[MPSAutocompleteResult], Error>) -> Void) { var request: URLRequest do { - request = try essentialRequest(withEndpoint: Endpoint.autocomleteSearch, - query: nil, - httpMethod: HTTPMethod.post) + request = try urlRequest(withPath: Endpoint.autocomleteSearch, + queryItems: nil, + httpMethod: HTTPMethod.post) } catch let requestError { completionHandler(.failure(requestError)) return @@ -336,11 +445,11 @@ public class MPSMapirServices { return } - session.dataTask(with: request) { (data, urlResponse, error) in + let dataTask = session.dataTask(with: request) { (data, urlResponse, error) in if let error = error { DispatchQueue.main.async { completionHandler(.failure(error)) } } guard let urlResponse = urlResponse as? HTTPURLResponse else { - DispatchQueue.main.async { completionHandler(.failure(MPSError.invalidResponse)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.invalidResponse)) } return } @@ -348,8 +457,9 @@ public class MPSMapirServices { case 200: if let data = data { do { - let decodedData = try self.decoder.decode(MPSAutocompleteSearch.self, from: data) - DispatchQueue.main.async { completionHandler(.success(decodedData)) } + let decodedData = try self.decoder.decode(MPSAutocomplete.self, from: data) + let autocompleteResult = decodedData.results + DispatchQueue.main.async { completionHandler(.success(autocompleteResult)) } return } catch let parseError { DispatchQueue.main.async { completionHandler(.failure(parseError)) } @@ -357,54 +467,72 @@ public class MPSMapirServices { } } case 400: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.badRequest)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.badRequest)) } return case 404: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.notFound)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.notFound)) } return default: return } - }.resume() + } + + dataTask.resume() } - public func getRoute(from origin: CLLocationCoordinate2D, - to destinations: [CLLocationCoordinate2D], - routeType: MPSRouteType, - routeOptions: MPSRouteOptions = [], - completionHandler: @escaping (Result) -> Void) { + /// Calculates routes from an origin to one or more destinations. + /// + /// - Parameter origin: origin point. + /// - Parameter destinations: coordinates of destinations. may be one or more destination in order. + /// - Parameter routeType: type of route. e.g. bicycle. + /// - Parameter routeOptions: options of routing. + /// - Parameter result: a `Result` of types `MPSRouteResult` if execution succeeds and `Error` if it fails. + /// + /// Route method is used to find paths between one ore more places. This method considers traffic for finding path for some of route types. + /// OSRM is used for route calculation. for more information use + /// [OSRM documentation](http://project-osrm.org/docs/v5.22.0/api/?language=Swift#general-options). + public func route(from origin: CLLocationCoordinate2D, + to destinations: [CLLocationCoordinate2D], + routeMode: MPSRoute.Mode, + routeOptions: MPSRoute.Options = [], + completionHandler: @escaping (_ result: Result<([MPSWaypoint], [MPSRoute]), Error>) -> Void) { guard !destinations.isEmpty else { completionHandler(.failure(MPSError.RequestError.invalidArgument)) return } - var query = "/" - query += "\(origin.longitude),\(origin.latitude);" + var path = Endpoint.route(forMode: routeMode) + "/" + path += "\(origin.longitude),\(origin.latitude);" for dest in destinations { - query += "\(dest.longitude),\(dest.latitude);" + path += "\(dest.longitude),\(dest.latitude);" } - query.removeLast() - query += "?steps=true" + path.removeLast() + + var queryItems = [URLQueryItem(name: "steps", value: "true")] if routeOptions.contains(.calculateAlternatives) { - query += "&alternatives=true" + queryItems.append(URLQueryItem(name: "alternatives", value: "true")) } - if routeOptions.contains(.overview) { - query += "&overview=full" + + if routeOptions.contains(.steps) { + queryItems.append(URLQueryItem(name: "steps", value: "true")) } - guard let urlEncodedQuery = query.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { - completionHandler(.failure(MPSError.RequestError.invalidArgument)) - return + if routeOptions.contains(.fullOverview) { + queryItems.append(URLQueryItem(name: "overview", value: "full")) + } else if routeOptions.contains(.simplifiedOverview) { + queryItems.append(URLQueryItem(name: "overview", value: "simplified")) + } else if routeOptions.contains(.noOverview) { + queryItems.append(URLQueryItem(name: "overview", value: "false")) } let request: URLRequest do { - request = try essentialRequest(withEndpoint: Endpoint.route(forType: routeType), - query: urlEncodedQuery, - httpMethod: HTTPMethod.get) + request = try urlRequest(withPath: path, + queryItems: queryItems, + httpMethod: HTTPMethod.get) } catch let requestError { completionHandler(.failure(requestError)) return @@ -412,13 +540,13 @@ public class MPSMapirServices { - session.dataTask(with: request) { (data, urlResponse, error) in + let dataTask = session.dataTask(with: request) { (data, urlResponse, error) in if let error = error { DispatchQueue.main.async { completionHandler(.failure(error)) } } guard let urlResponse = urlResponse as? HTTPURLResponse else { - DispatchQueue.main.async { completionHandler(.failure(MPSError.invalidResponse)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.invalidResponse)) } return } @@ -426,72 +554,151 @@ public class MPSMapirServices { case 200: if let data = data { do { - let decodedData = try self.decoder.decode(MPSRouteObject.self, from: data) - DispatchQueue.main.async { completionHandler(.success(decodedData)) } + let decodedData = try self.decoder.decode(MPSRouteResult.self, from: data) + DispatchQueue.main.async { + completionHandler(.success( + (decodedData.waypoints, decodedData.routes) + )) + } } catch let decoderError { DispatchQueue.main.async { completionHandler(.failure(decoderError)) } return } } case 400: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.badRequest)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.badRequest)) } return case 404: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.notFound)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.notFound)) } return default: return } - }.resume() + } + + dataTask.resume() } - public func getStaticMap(center: CLLocationCoordinate2D, - size: CGSize, - zoomLevel: Int, - markers: [MPSStaticMapMarker] = [], - completionHandler: @escaping (Result) -> Void) { + #if os(iOS) || os(watchOS) || os(tvOS) + /// Generates static map of an area of the map. + /// + /// - Parameter center: Center point of the map. + /// - Parameter size: size of the image. in pixels. + /// - Parameter zoomLevel: Zoom level of the map. + /// - Parameter markers: List of markers which is needed on the map. + /// - Parameter result: a `Result` of types `UIImage` if execution succeeds and `Error` if it fails. + public func staticMap(center: CLLocationCoordinate2D, + size: CGSize, + zoomLevel: Int, + markers: [MPSStaticMapMarker] = [], + completionHandler: @escaping (_ result: Result) -> Void) { + + var queryItems = [URLQueryItem(name: "width", value: "\(Int(size.width))"), + URLQueryItem(name: "height", value: "\(Int(size.height))"), + URLQueryItem(name: "zoom_level", value: "\(zoomLevel))")] + + if !markers.isEmpty { + for marker in markers { + let value = "color:\(marker.style.rawValue)|label:\(marker.label)|\(marker.coordinate.longitude),\(marker.coordinate.latitude)" + queryItems.append(URLQueryItem(name: "markers", value: value)) + } + } - guard !markers.isEmpty else { - completionHandler(.failure(MPSError.RequestError.invalidArgument)) + let request: URLRequest + do { + request = try urlRequest(withPath: Endpoint.staticMap, + queryItems: queryItems, + httpMethod: HTTPMethod.get) + } catch let requestError { + completionHandler(.failure(requestError)) return } - var query = "?width=\(Int(size.width))&height=\(Int(size.height))&zoom_level=\(zoomLevel)" + let dataTask = session.dataTask(with: request) { (data, urlResponse, error) in + if let error = error { + DispatchQueue.main.async { completionHandler(.failure(error)) } + return + } + + guard let urlResponse = urlResponse as? HTTPURLResponse else { + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.invalidResponse)) } + return + } - for marker in markers { - query += "&markers=color:\(marker.style.rawValue)|label:\(marker.label)|\(marker.coordinate.longitude),\(marker.coordinate.latitude)" + switch urlResponse.statusCode { + case 200: + if let data = data { + if let decodedImage = UIImage(data: data) { + DispatchQueue.main.async { completionHandler(.success(decodedImage)) } + return + } else { + DispatchQueue.main.async { completionHandler(.failure(MPSError.imageDecodingError)) } + } + } + case 400: + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.badRequest)) } + return + case 404: + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.notFound)) } + return + default: + return + } } - guard let urlEncodedQuery = query.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { - completionHandler(.failure(MPSError.urlEncodingError)) - return + dataTask.resume() + } + + #elseif os(macOS) + /// Generates static map of an area of the map. + /// + /// - Parameter center: Center point of the map. + /// - Parameter size: size of the image. in pixels. + /// - Parameter zoomLevel: Zoom level of the map. + /// - Parameter markers: List of markers which is needed on the map. + /// - Parameter result: a `Result` of types `NSImage` if execution succeeds and `Error` if it fails. + public func staticMap(center: CLLocationCoordinate2D, + size: CGSize, + zoomLevel: Int, + markers: [MPSStaticMapMarker] = [], + completionHandler: @escaping (_ result: Result) -> Void) { + + var queryItems = [URLQueryItem(name: "width", value: "\(Int(size.width))"), + URLQueryItem(name: "height", value: "\(Int(size.height))"), + URLQueryItem(name: "zoom_level", value: "\(zoomLevel))")] + + if !markers.isEmpty { + for marker in markers { + let value = "color:\(marker.style.rawValue)|label:\(marker.label)|\(marker.coordinate.longitude),\(marker.coordinate.latitude)" + queryItems.append(URLQueryItem(name: "markers", value: value)) + } } let request: URLRequest do { - request = try essentialRequest(withEndpoint: Endpoint.staticMap, - query: urlEncodedQuery, - httpMethod: HTTPMethod.get) + request = try urlRequest(withPath: Endpoint.staticMap, + queryItems: queryItems, + httpMethod: HTTPMethod.get) } catch let requestError { completionHandler(.failure(requestError)) return } - session.dataTask(with: request) { (data, urlResponse, error) in + let dataTask = session.dataTask(with: request) { (data, urlResponse, error) in if let error = error { DispatchQueue.main.async { completionHandler(.failure(error)) } return } guard let urlResponse = urlResponse as? HTTPURLResponse else { - DispatchQueue.main.async { completionHandler(.failure(MPSError.invalidResponse)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.invalidResponse)) } return } switch urlResponse.statusCode { case 200: if let data = data { - if let decodedImage = UIImage(data: data) { + if let decodedImage = NSImage(data: data) { DispatchQueue.main.async { completionHandler(.success(decodedImage)) } return } else { @@ -499,14 +706,17 @@ public class MPSMapirServices { } } case 400: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.badRequest)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.badRequest)) } return case 404: - DispatchQueue.main.async { completionHandler(.failure(MPSError.RequestError.notFound)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.notFound)) } return default: return } - }.resume() + } + + dataTask.resume() } + #endif } diff --git a/Sources/Models/MPSAutocompleteSearch.swift b/Sources/Models/MPSAutocomplete.swift similarity index 72% rename from Sources/Models/MPSAutocompleteSearch.swift rename to Sources/Models/MPSAutocomplete.swift index c034b9a..8f6d0b7 100644 --- a/Sources/Models/MPSAutocompleteSearch.swift +++ b/Sources/Models/MPSAutocomplete.swift @@ -8,12 +8,12 @@ import Foundation -public struct MPSAutocompleteSearch { +public struct MPSAutocomplete { var allResultsCount: Int - var results: [MPSAutocompleteSearchResult] + var results: [MPSAutocompleteResult] } -extension MPSAutocompleteSearch: Decodable { +extension MPSAutocomplete: Decodable { enum CodingKeys: String, CodingKey { case allResultsCount = "odata.count" case results = "value" diff --git a/Sources/Models/MPSAutocompleteSearchResult.swift b/Sources/Models/MPSAutocompleteResult.swift similarity index 74% rename from Sources/Models/MPSAutocompleteSearchResult.swift rename to Sources/Models/MPSAutocompleteResult.swift index 40c0238..208652e 100644 --- a/Sources/Models/MPSAutocompleteSearchResult.swift +++ b/Sources/Models/MPSAutocompleteResult.swift @@ -8,4 +8,4 @@ import Foundation -public typealias MPSAutocompleteSearchResult = MPSSearchResult +public typealias MPSAutocompleteResult = MPSSearchResult diff --git a/Sources/Models/MPSDistanceMatrix.swift b/Sources/Models/MPSDistanceMatrix.swift index b11ce2a..7597048 100755 --- a/Sources/Models/MPSDistanceMatrix.swift +++ b/Sources/Models/MPSDistanceMatrix.swift @@ -9,6 +9,20 @@ import Foundation public struct MPSDistanceMatrix { + + public struct Options: OptionSet { + + public let rawValue: Int + + public init(rawValue: Int) { + self.rawValue = rawValue + } + + public static let distance = MPSDistanceMatrix.Options(rawValue: 1 << 0) + public static let duration = MPSDistanceMatrix.Options(rawValue: 1 << 1) + public static let sorted = MPSDistanceMatrix.Options(rawValue: 1 << 2) + } + public var distances: [MPSDistance] public var durations: [MPSDuration] public var origins: [MPSLocation] @@ -90,16 +104,3 @@ extension MPSDistanceMatrix: Decodable { } } } - -public struct MPSDistanceMatrixOptions: OptionSet { - - public let rawValue: Int - - public init(rawValue: Int) { - self.rawValue = rawValue - } - - public static let distance = MPSDistanceMatrixOptions(rawValue: 1 << 0) - public static let duration = MPSDistanceMatrixOptions(rawValue: 1 << 1) - public static let sorted = MPSDistanceMatrixOptions(rawValue: 1 << 2) -} diff --git a/Sources/Models/Routing/MPSLane.swift b/Sources/Models/Routing/MPSLane.swift index 634b875..0e1dd51 100644 --- a/Sources/Models/Routing/MPSLane.swift +++ b/Sources/Models/Routing/MPSLane.swift @@ -11,10 +11,40 @@ import Foundation /// A Lane represents a turn lane at the corresponding turn location. public struct MPSLane { + public enum Indication: String, Codable { + + /// No dedicated indication is shown. + case none + + /// a normal turn to the right + case right + + /// a normal turn to the left + case left + + /// a slight turn to the right + case slightRight = "slight right" + + /// a slight turn to the left + case slightLeft = "slight left" + + /// a sharp right turn + case sharpRight = "sharp right" + + /// a sharp turn to the left + case sharpLeft = "sharp left" + + /// indicates reversal of direction + case uturn + + /// no relevant change in direction + case straight + } + /// a indication (e.g. marking on the road) specifying the turn lane. /// - A road can have multiple indications (e.g. an arrow pointing straight and left). /// The indications are given in an array, each containing one of the following types. - public var indications: [MPSLaneIndication] + public var indications: [MPSLane.Indication] /// a boolean flag indicating whether the lane is a valid choice in the current maneuver. public var valid: Bool @@ -31,36 +61,6 @@ extension MPSLane: Decodable { let container = try decoder.container(keyedBy: CodingKeys.self) valid = try container.decode(Bool.self, forKey: .valid) - indications = try container.decode([MPSLaneIndication].self, forKey: .indications) + indications = try container.decode([MPSLane.Indication].self, forKey: .indications) } } - -public enum MPSLaneIndication: String, Codable { - - /// No dedicated indication is shown. - case none - - /// a normal turn to the right - case right - - /// a normal turn to the left - case left - - /// a slight turn to the right - case slightRight = "slight right" - - /// a slight turn to the left - case slightLeft = "slight left" - - /// a sharp right turn - case sharpRight = "sharp right" - - /// a sharp turn to the left - case sharpLeft = "sharp left" - - /// indicates reversal of direction - case uturn - - /// no relevant change in direction - case straight -} diff --git a/Sources/Models/Routing/MPSManeuver.swift b/Sources/Models/Routing/MPSManeuver.swift index 50b57f1..eacbf43 100644 --- a/Sources/Models/Routing/MPSManeuver.swift +++ b/Sources/Models/Routing/MPSManeuver.swift @@ -10,6 +10,96 @@ import CoreLocation import Foundation public struct MPSManeuver { + + public enum ManeuverType: String, Decodable { + /// a basic turn into direction of the `modifier` + case turn + + /// no turn is taken/possible, but the road name changes. The road can take a turn itself, following `modifier` . + case newName = "new name" + + /// indicates the departure of the leg + case depart + + /// indicates the destination of the leg + case arrive + + /// merge onto a street (e.g. getting on the highway from a ramp, + /// the `modifier` specifies the direction of the merge ) + case merge + + /// __Deprecated__. Replaced by `on_ramp` and `off_ramp `. + case ramp + + /// take a ramp to enter a highway (direction given by `modifier` ) + case onRamp = "on ramp" + + /// take a ramp to exit a highway (direction given by `modifier`) + case offRamp = "off ramp" + + /// take the left/right side at a fork depending on `modifier` + case fork + + /// road ends in a T intersection turn in direction of `modifier` + case endOfRoad = "end of road" + + /// __Deprecated__. going straight on a specific lane + case useLane = "use lane" + + /// Turn in direction of `modifier` to stay on the same road + case `continue` + + /// traverse `roundabout`, has additional field `exit` with NR if the `roundabout` is left. + /// the `modifier` specifies the direction of entering the roundabout + case roundabout + + /// a traffic circle. While very similar to a larger version of a roundabout, + /// it does not necessarily follow roundabout rules for right of way. + /// It can offer `rotary_name/rotary_pronunciation` in addition to the `exit` parameter. + case rotary + + /// Describes a turn at a small roundabout that should be treated as normal turn. + /// The modifier indicates the turn direciton. + case roundaboutTurn = "roundabout trun" + + /// not an actual turn but a change in the driving conditions. For example the travel mode. + /// If the road takes a turn itself, the modifier describes the direction + case notification + + /// Describes a maneuver exiting a roundabout (usually preceeded by a `roundabout` instruction) + case exitRoundabout = "exit roundabout" + + /// Describes the maneuver exiting a rotary (large named `roundabout`) + case exitRotary = "exit rotary" + } + + public enum Modifier: String, Decodable { + + /// a normal turn to the right + case right + + /// a normal turn to the left + case left + + /// a slight turn to the right + case slightRight = "slight right" + + /// a slight turn to the left + case slightLeft = "slight left" + + /// a sharp right turn + case sharpRight = "sharp right" + + /// a sharp turn to the left + case sharpLeft = "sharp left" + + /// indicates reversal of direction + case uturn + + /// no relevant change in direction + case straight + } + /// A `CLLocationCoordinate2D` describing the location of the turn. public var location: CLLocationCoordinate2D? @@ -20,10 +110,10 @@ public struct MPSManeuver { public var bearingBefore: Int /// An enum indicating the type of maneuver. - public var type: MPSManeuverType + public var type: MPSManeuver.ManeuverType /// An optional `String` indicating the direction change of the maneuver. - public var modifier: MPSManeuverModifier? + public var modifier: MPSManeuver.Modifier? /// An optional `Integer` indicating number of the exit to take. /// The field exists for the following `type` field: `roundabout / rotary` and `else` @@ -49,97 +139,8 @@ extension MPSManeuver: Decodable { } bearingAfter = try container.decode(Int.self, forKey: .bearingAfter) bearingBefore = try container.decode(Int.self, forKey: .bearingBefore) - type = try container.decode(MPSManeuverType.self, forKey: .type) - modifier = try? container.decode(MPSManeuverModifier.self, forKey: .modifier) + type = try container.decode(MPSManeuver.ManeuverType.self, forKey: .type) + modifier = try? container.decode(MPSManeuver.Modifier.self, forKey: .modifier) exit = try? container.decode(Int.self, forKey: .exit) } } - -public enum MPSManeuverType: String, Decodable { - /// a basic turn into direction of the `modifier` - case turn - - /// no turn is taken/possible, but the road name changes. The road can take a turn itself, following `modifier` . - case newName = "new name" - - /// indicates the departure of the leg - case depart - - /// indicates the destination of the leg - case arrive - - /// merge onto a street (e.g. getting on the highway from a ramp, - /// the `modifier` specifies the direction of the merge ) - case merge - - /// __Deprecated__. Replaced by `on_ramp` and `off_ramp `. - case ramp - - /// take a ramp to enter a highway (direction given by `modifier` ) - case onRamp = "on ramp" - - /// take a ramp to exit a highway (direction given by `modifier`) - case offRamp = "off ramp" - - /// take the left/right side at a fork depending on `modifier` - case fork - - /// road ends in a T intersection turn in direction of `modifier` - case endOfRoad = "end of road" - - /// __Deprecated__. going straight on a specific lane - case useLane = "use lane" - - /// Turn in direction of `modifier` to stay on the same road - case `continue` - - /// traverse `roundabout`, has additional field `exit` with NR if the `roundabout` is left. - /// the `modifier` specifies the direction of entering the roundabout - case roundabout - - /// a traffic circle. While very similar to a larger version of a roundabout, - /// it does not necessarily follow roundabout rules for right of way. - /// It can offer `rotary_name/rotary_pronunciation` in addition to the `exit` parameter. - case rotary - - /// Describes a turn at a small roundabout that should be treated as normal turn. - /// The modifier indicates the turn direciton. - case roundaboutTurn = "roundabout trun" - - /// not an actual turn but a change in the driving conditions. For example the travel mode. - /// If the road takes a turn itself, the modifier describes the direction - case notification - - /// Describes a maneuver exiting a roundabout (usually preceeded by a `roundabout` instruction) - case exitRoundabout = "exit roundabout" - - /// Describes the maneuver exiting a rotary (large named `roundabout`) - case exitRotary = "exit rotary" -} - -public enum MPSManeuverModifier: String, Decodable { - - /// a normal turn to the right - case right - - /// a normal turn to the left - case left - - /// a slight turn to the right - case slightRight = "slight right" - - /// a slight turn to the left - case slightLeft = "slight left" - - /// a sharp right turn - case sharpRight = "sharp right" - - /// a sharp turn to the left - case sharpLeft = "sharp left" - - /// indicates reversal of direction - case uturn - - /// no relevant change in direction - case straight -} diff --git a/Sources/Models/Routing/MPSRoute.swift b/Sources/Models/Routing/MPSRoute.swift index 720dec4..22514c6 100644 --- a/Sources/Models/Routing/MPSRoute.swift +++ b/Sources/Models/Routing/MPSRoute.swift @@ -12,6 +12,26 @@ import Polyline public struct MPSRoute { + public enum Mode: String { + case drivingExcludeAirPollutionZone = "zojofard" + case drivingExcludeTrafficControlZone = "tarh" + case drivingNoExclusion = "route" + case onFoot = "foot" + case bicycle = "bicycle" + } + + public struct Options: OptionSet { + public let rawValue: Int + + public init(rawValue: Int) { self.rawValue = rawValue } + + public static let calculateAlternatives = MPSRoute.Options(rawValue: 1 << 0) + public static let fullOverview = MPSRoute.Options(rawValue: 1 << 1) + public static let simplifiedOverview = MPSRoute.Options(rawValue: 1 << 2) + public static let noOverview = MPSRoute.Options(rawValue: 1 << 3) + public static let steps = MPSRoute.Options(rawValue: 1 << 4) + } + /// The distance traveled by the route, in `Double` meters. public var distance: Double @@ -62,20 +82,3 @@ extension MPSRoute: Decodable { legs = try container.decode([MPSLeg].self, forKey: .legs) } } - -public enum MPSRouteType: String { - case drivingExcludeAirPollutionZone = "zojofard" - case drivingExcludeTrafficControlZone = "tarh" - case drivingNoExclusion = "route" - case onFoot = "foot" - case bicycle = "bicycle" -} - -public struct MPSRouteOptions: OptionSet { - public let rawValue: Int - - public init(rawValue: Int) { self.rawValue = rawValue } - - public static let calculateAlternatives = MPSRouteOptions(rawValue: 1 << 0) - public static let overview = MPSRouteOptions(rawValue: 1 << 1) -} diff --git a/Sources/Models/Routing/MPSRouteObject.swift b/Sources/Models/Routing/MPSRouteResult.swift similarity index 83% rename from Sources/Models/Routing/MPSRouteObject.swift rename to Sources/Models/Routing/MPSRouteResult.swift index 27bb996..b34aeab 100644 --- a/Sources/Models/Routing/MPSRouteObject.swift +++ b/Sources/Models/Routing/MPSRouteResult.swift @@ -8,12 +8,12 @@ import Foundation -public struct MPSRouteObject { +public struct MPSRouteResult { public var routes: [MPSRoute] public var waypoints: [MPSWaypoint] } -extension MPSRouteObject: Decodable { +extension MPSRouteResult: Decodable { enum CodingKeys: String, CodingKey { case routes case waypoints diff --git a/Sources/Models/Routing/MPSWaypoint.swift b/Sources/Models/Routing/MPSWaypoint.swift index 8129386..f943305 100644 --- a/Sources/Models/Routing/MPSWaypoint.swift +++ b/Sources/Models/Routing/MPSWaypoint.swift @@ -16,6 +16,9 @@ public struct MPSWaypoint { /// Name of the street the coordinate snapped to. public var name: String + /// The distance, in metres, from the input coordinate to the snapped coordinate + public var distance: Double + /// `CLLocationCoordinate2D` of the snapped coordinate. public var coordinates: CLLocationCoordinate2D? } @@ -24,6 +27,7 @@ extension MPSWaypoint: Decodable { enum CodingKeys: String, CodingKey { case hint case name + case distance case coordinates = "location" } @@ -32,6 +36,7 @@ extension MPSWaypoint: Decodable { hint = try container.decode(String.self, forKey: .hint) name = try container.decode(String.self, forKey: .name) + distance = try container.decode(Double.self, forKey: .distance) let coords = try? container.decode([Double].self, forKey: .coordinates) if let coords = coords {