From c3e9cbafd96b125be793361c76562a80d708dc26 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Mon, 22 Jul 2019 16:10:42 +0430 Subject: [PATCH 01/22] Updated errors and their documentations. --- Sources/Core/MPSError.swift | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) 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 } From 75e653189be8ab1b2c990200c01a506973c06b1f Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Tue, 23 Jul 2019 14:49:03 +0430 Subject: [PATCH 02/22] property lists updated and created for macOS version of SDK. --- ...Services.plist => MapirServices-iOS.plist} | 0 Configs/MapirServices-macOS.plist | 24 +++++++++++++++++++ ...sts.plist => MapirServicesTests-iOS.plist} | 0 Configs/MapirServicesTests-macOS.plist | 22 +++++++++++++++++ Sources/MapirServices.h | 19 +++++++++++++++ 5 files changed, 65 insertions(+) rename Configs/{MapirServices.plist => MapirServices-iOS.plist} (100%) create mode 100644 Configs/MapirServices-macOS.plist rename Configs/{MapirServicesTests.plist => MapirServicesTests-iOS.plist} (100%) create mode 100644 Configs/MapirServicesTests-macOS.plist create mode 100644 Sources/MapirServices.h diff --git a/Configs/MapirServices.plist b/Configs/MapirServices-iOS.plist similarity index 100% rename from Configs/MapirServices.plist rename to Configs/MapirServices-iOS.plist diff --git a/Configs/MapirServices-macOS.plist b/Configs/MapirServices-macOS.plist new file mode 100644 index 0000000..8e831a1 --- /dev/null +++ b/Configs/MapirServices-macOS.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + $(MARKETING_VERSION) + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSHumanReadableCopyright + Copyright © 1398 AP Map. All rights reserved. + + diff --git a/Configs/MapirServicesTests.plist b/Configs/MapirServicesTests-iOS.plist similarity index 100% rename from Configs/MapirServicesTests.plist rename to Configs/MapirServicesTests-iOS.plist diff --git a/Configs/MapirServicesTests-macOS.plist b/Configs/MapirServicesTests-macOS.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/Configs/MapirServicesTests-macOS.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/Sources/MapirServices.h b/Sources/MapirServices.h new file mode 100644 index 0000000..e11eaf9 --- /dev/null +++ b/Sources/MapirServices.h @@ -0,0 +1,19 @@ +// +// MapirServices.h +// MapirServices +// +// Created by Alireza Asadi on 31/4/1398 AP. +// Copyright © 1398 AP Map. All rights reserved. +// + +#import + +//! Project version number for MapirServices_macOS. +FOUNDATION_EXPORT double MapirServices_macOSVersionNumber; + +//! Project version string for MapirServices_macOS. +FOUNDATION_EXPORT const unsigned char MapirServices_macOSVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + From e45748de6bf8e14a5b90e09149e27a109eacbb00 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Tue, 23 Jul 2019 14:49:28 +0430 Subject: [PATCH 03/22] project and documentation setting updated. --- .jazzy.yaml | 2 +- MapirServices.xcodeproj/project.pbxproj | 495 ++++++++++++++++-- Sources/MapirServices.swift | 288 +++++++--- ...leteSearch.swift => MPSAutocomplete.swift} | 6 +- ...sult.swift => MPSAutocompleteResult.swift} | 2 +- ...RouteObject.swift => MPSRouteResult.swift} | 4 +- Tests/MapirServices_macOSTests.swift | 34 ++ 7 files changed, 725 insertions(+), 106 deletions(-) rename Sources/Models/{MPSAutocompleteSearch.swift => MPSAutocomplete.swift} (72%) rename Sources/Models/{MPSAutocompleteSearchResult.swift => MPSAutocompleteResult.swift} (74%) rename Sources/Models/Routing/{MPSRouteObject.swift => MPSRouteResult.swift} (83%) create mode 100644 Tests/MapirServices_macOSTests.swift 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/MapirServices.xcodeproj/project.pbxproj b/MapirServices.xcodeproj/project.pbxproj index a7bec7f..c645923 100644 --- a/MapirServices.xcodeproj/project.pbxproj +++ b/MapirServices.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 51; objects = { /* Begin PBXAggregateTarget section */ @@ -31,6 +31,8 @@ 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 */; }; + C004681E22E5DE2C00CF922E /* MapirServices_macOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C004681422E5DDD100CF922E /* MapirServices_macOSTests.swift */; }; 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 +41,48 @@ 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, ); }; }; 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 */; }; C0FBFA2822D2009400A03FCC /* MPSStaticMapMarker.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0FBFA2722D2009400A03FCC /* MPSStaticMapMarker.swift */; }; /* End PBXBuildFile section */ @@ -73,6 +101,62 @@ 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; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -87,13 +171,24 @@ 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; + }; 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; @@ -102,8 +197,8 @@ /* Begin PBXFileReference section */ 3D9C429022745894000A6585 /* MapirServices.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3D9C429C227458E8000A6585 /* MapirServices.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = MapirServices.plist; sourceTree = ""; }; - 3D9C429D227458E8000A6585 /* MapirServicesTests.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = MapirServicesTests.plist; sourceTree = ""; }; + 3D9C429C227458E8000A6585 /* MapirServices-iOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MapirServices-iOS.plist"; sourceTree = ""; }; + 3D9C429D227458E8000A6585 /* MapirServicesTests-iOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MapirServicesTests-iOS.plist"; sourceTree = ""; }; 3D9C42A122745900000A6585 /* MapirServices.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapirServices.swift; sourceTree = ""; }; 3D9C42A92274599D000A6585 /* MapirServices.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3D9C42B7227459D6000A6585 /* MapirServices.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -128,6 +223,12 @@ 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 = ""; }; + C004680A22E5DDD000CF922E /* MapirServices-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServices-macOS.plist"; sourceTree = ""; }; + C004680F22E5DDD000CF922E /* MapirServices-macOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "MapirServices-macOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + C004681422E5DDD100CF922E /* MapirServices_macOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapirServices_macOSTests.swift; sourceTree = ""; }; + C004681622E5DDD100CF922E /* MapirServicesTests-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServicesTests-macOS.plist"; sourceTree = ""; }; 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 +238,23 @@ 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 = ""; }; 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 +263,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C0D3D3B722DF0687005419F3 /* Polyline.framework in Frameworks */, + C056047022E6ED0B004A2F9C /* Polyline.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -183,6 +283,22 @@ ); 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; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -210,6 +326,8 @@ 3D9C43012274611B000A6585 /* MapirServices-tvOSTests.xctest */, 3D9C431122746198000A6585 /* MapirServices-macOSTests.xctest */, 3D9C43212274629B000A6585 /* Example.app */, + C004680722E5DDD000CF922E /* MapirServices_macOS.framework */, + C004680F22E5DDD000CF922E /* MapirServices-macOSTests.xctest */, ); name = Products; sourceTree = ""; @@ -217,8 +335,10 @@ 3D9C429B227458E8000A6585 /* Configs */ = { isa = PBXGroup; children = ( - 3D9C429C227458E8000A6585 /* MapirServices.plist */, - 3D9C429D227458E8000A6585 /* MapirServicesTests.plist */, + 3D9C429C227458E8000A6585 /* MapirServices-iOS.plist */, + 3D9C429D227458E8000A6585 /* MapirServicesTests-iOS.plist */, + C004680A22E5DDD000CF922E /* MapirServices-macOS.plist */, + C004681622E5DDD100CF922E /* MapirServicesTests-macOS.plist */, 3D9C42D422745B48000A6585 /* MapirServices.podspec */, 3D9C42D322745B48000A6585 /* Package.swift */, 3D9C42D622745C9D000A6585 /* Fastfile */, @@ -237,6 +357,7 @@ 3D9C42A0227458FA000A6585 /* Sources */ = { isa = PBXGroup; children = ( + C004680922E5DDD000CF922E /* MapirServices.h */, 3D9C42A122745900000A6585 /* MapirServices.swift */, C04CF66722A27D57009761C4 /* Core */, C04CF65D22A25E1E009761C4 /* Models */, @@ -250,6 +371,7 @@ children = ( 3D9C42EC22745FDA000A6585 /* LinuxMain.swift */, 3D9C42D722745CDE000A6585 /* MapirServicesTests.swift */, + C004681422E5DDD100CF922E /* MapirServices_macOSTests.swift */, ); path = Tests; sourceTree = ""; @@ -286,8 +408,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 +428,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 +465,7 @@ C02DCF6C22CA213B00BA403F /* MPSIntersection.swift */, C08DB44C22CB302600FAE64A /* MPSLane.swift */, C08DB44E22CB570800FAE64A /* MPSRoute.swift */, - C0B79B2122D361BB005E9C24 /* MPSRouteObject.swift */, + C0B79B2122D361BB005E9C24 /* MPSRouteResult.swift */, ); path = Routing; sourceTree = ""; @@ -345,6 +480,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C004680222E5DDD000CF922E /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXHeadersBuildPhase section */ /* Begin PBXNativeTarget section */ @@ -406,6 +548,43 @@ 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"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -413,7 +592,7 @@ isa = PBXProject; attributes = { CLASSPREFIX = ""; - LastSwiftUpdateCheck = 1020; + LastSwiftUpdateCheck = 1100; LastUpgradeCheck = 1020; ORGANIZATIONNAME = Map; TargetAttributes = { @@ -427,6 +606,12 @@ 3D9C43202274629B000A6585 = { CreatedOnToolsVersion = 10.2.1; }; + C004680622E5DDD000CF922E = { + CreatedOnToolsVersion = 11.0; + }; + C004680E22E5DDD000CF922E = { + CreatedOnToolsVersion = 11.0; + }; C035B3EE22DB4F340083BBD4 = { CreatedOnToolsVersion = 11.0; }; @@ -445,16 +630,76 @@ ); productRefGroup = 3D9C429122745894000A6585 /* Products */; projectDirPath = ""; + projectReferences = ( + { + ProductGroup = C056045922E6ED01004A2F9C /* Products */; + ProjectRef = C056045822E6ED01004A2F9C /* Polyline.xcodeproj */; + }, + ); projectRoot = ""; targets = ( 3D9C428F22745894000A6585 /* MapirServices-iOS */, + C004680622E5DDD000CF922E /* MapirServices-macOS */, 3D9C42F02274604A000A6585 /* MapirServices-iOSTests */, + C004680E22E5DDD000CF922E /* MapirServices-macOSTests */, 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,6 +724,20 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C004680522E5DDD000CF922E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C004680D22E5DDD000CF922E /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -528,9 +787,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 +797,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 */, @@ -557,6 +816,7 @@ buildActionMask = 2147483647; files = ( 3D9C42FC22746078000A6585 /* MapirServicesTests.swift in Sources */, + C004681E22E5DE2C00CF922E /* MapirServices_macOSTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -569,6 +829,44 @@ ); 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 = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -582,6 +880,11 @@ target = 3D9C428F22745894000A6585 /* MapirServices-iOS */; targetProxy = 3D9C433622746323000A6585 /* PBXContainerItemProxy */; }; + C004681222E5DDD100CF922E /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C004680622E5DDD000CF922E /* MapirServices-macOS */; + targetProxy = C004681122E5DDD100CF922E /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -736,7 +1039,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); - INFOPLIST_FILE = Configs/MapirServices.plist; + INFOPLIST_FILE = "Configs/MapirServices-iOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -745,7 +1048,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 0.1.0; - PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.services-iOS"; + PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.MapirServices-iOS"; PRODUCT_NAME = MapirServices; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; @@ -771,7 +1074,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); - INFOPLIST_FILE = Configs/MapirServices.plist; + INFOPLIST_FILE = "Configs/MapirServices-iOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -780,7 +1083,7 @@ "@loader_path/Frameworks", ); MARKETING_VERSION = 0.1.0; - PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.services-iOS"; + PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.MapirServices-iOS"; PRODUCT_NAME = MapirServices; PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; @@ -793,7 +1096,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 +1114,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)", @@ -871,6 +1174,114 @@ }; name = Release; }; + C004681822E5DDD100CF922E /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + 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-macOS.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 0.1.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 = { + 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-macOS.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/../Frameworks", + "@loader_path/Frameworks", + ); + MACOSX_DEPLOYMENT_TARGET = 10.13; + MARKETING_VERSION = 0.1.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; + }; + 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; + }; C035B3EF22DB4F350083BBD4 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -928,6 +1339,24 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 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; + }; C035B3F122DB4F350083BBD4 /* Build configuration list for PBXAggregateTarget "UniversalBinary" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/Sources/MapirServices.swift b/Sources/MapirServices.swift index 5759299..02cf585 100644 --- a/Sources/MapirServices.swift +++ b/Sources/MapirServices.swift @@ -9,10 +9,16 @@ // Include Foundation @_exported import Foundation import CoreLocation + +#if os(iOS) 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" @@ -26,6 +32,7 @@ public class MPSMapirServices { } + /// Singleton object of MPSMapirServices public static let shared = MPSMapirServices() let baseURL: URL! = URL(string: "https://map.ir") @@ -56,15 +63,24 @@ public class MPSMapirServices { 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") return request } - public func getReverseGeocode(for point: CLLocationCoordinate2D, - completionHandler: @escaping (Result) -> Void) { + /// 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 query: String = "?lat=\(point.latitude)&lon=\(point.longitude)" @@ -82,7 +98,7 @@ public class MPSMapirServices { return } guard let urlResponse = urlResponse as? HTTPURLResponse else { - completionHandler(.failure(MPSError.invalidResponse)) + completionHandler(.failure(MPSError.ResponseError.invalidResponse)) return } @@ -99,9 +115,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,8 +126,15 @@ 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)" @@ -125,14 +148,14 @@ 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)) } return } guard let urlResponse = urlResponse as? HTTPURLResponse else { - completionHandler(.failure(MPSError.invalidResponse)) + completionHandler(.failure(MPSError.ResponseError.invalidResponse)) return } @@ -149,22 +172,33 @@ 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) { + /// 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: MPSDistanceMatrixOptions = [], + completionHandler: @escaping (_ result: Result) -> Void) { var query: String = "?" query += "origins=" @@ -209,14 +243,14 @@ 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)) } return } guard let urlResponse = urlResponse as? HTTPURLResponse else { - completionHandler(.failure(MPSError.invalidResponse)) + completionHandler(.failure(MPSError.ResponseError.invalidResponse)) return } @@ -234,22 +268,34 @@ 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 { @@ -274,11 +320,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 +333,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,23 +342,32 @@ 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 { @@ -336,11 +392,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 +404,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,22 +414,35 @@ 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..., + routeType: MPSRouteType, + routeOptions: MPSRouteOptions = [], + completionHandler: @escaping (_ result: Result) -> Void) { guard !destinations.isEmpty else { completionHandler(.failure(MPSError.RequestError.invalidArgument)) @@ -412,13 +482,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,7 +496,7 @@ public class MPSMapirServices { case 200: if let data = data { do { - let decodedData = try self.decoder.decode(MPSRouteObject.self, from: data) + let decodedData = try self.decoder.decode(MPSRouteResult.self, from: data) DispatchQueue.main.async { completionHandler(.success(decodedData)) } } catch let decoderError { DispatchQueue.main.async { completionHandler(.failure(decoderError)) } @@ -434,22 +504,32 @@ 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 getStaticMap(center: CLLocationCoordinate2D, - size: CGSize, - zoomLevel: Int, - markers: [MPSStaticMapMarker] = [], - completionHandler: @escaping (Result) -> Void) { + #if os(iOS) + /// 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) { guard !markers.isEmpty else { completionHandler(.failure(MPSError.RequestError.invalidArgument)) @@ -477,14 +557,14 @@ 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)) } return } guard let urlResponse = urlResponse as? HTTPURLResponse else { - DispatchQueue.main.async { completionHandler(.failure(MPSError.invalidResponse)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.invalidResponse)) } return } @@ -499,14 +579,90 @@ 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.ResponseError.notFound)) } + return + default: + 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) { + + guard !markers.isEmpty else { + completionHandler(.failure(MPSError.RequestError.invalidArgument)) + return + } + + var query = "?width=\(Int(size.width))&height=\(Int(size.height))&zoom_level=\(zoomLevel)" + + for marker in markers { + query += "&markers=color:\(marker.style.rawValue)|label:\(marker.label)|\(marker.coordinate.longitude),\(marker.coordinate.latitude)" + } + + guard let urlEncodedQuery = query.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { + completionHandler(.failure(MPSError.urlEncodingError)) + return + } + + let request: URLRequest + do { + request = try essentialRequest(withEndpoint: Endpoint.staticMap, + query: urlEncodedQuery, + httpMethod: HTTPMethod.get) + } catch let requestError { + completionHandler(.failure(requestError)) + return + } + + 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 + } + + switch urlResponse.statusCode { + case 200: + if let data = data { + if let decodedImage = NSImage(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.RequestError.notFound)) } + DispatchQueue.main.async { completionHandler(.failure(MPSError.ResponseError.notFound)) } return default: return } }.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/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/Tests/MapirServices_macOSTests.swift b/Tests/MapirServices_macOSTests.swift new file mode 100644 index 0000000..cb4400a --- /dev/null +++ b/Tests/MapirServices_macOSTests.swift @@ -0,0 +1,34 @@ +// +// MapirServices_macOSTests.swift +// MapirServices-macOSTests +// +// Created by Alireza Asadi on 31/4/1398 AP. +// Copyright © 1398 AP Map. All rights reserved. +// + +import XCTest +@testable import MapirServices_macOS + +class MapirServices_macOSTests: XCTestCase { + + override func setUp() { + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} From 36536abe3a1affb15d0495c45477f25ad90ff262 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Tue, 23 Jul 2019 17:12:20 +0430 Subject: [PATCH 04/22] added support for watchOS and tvOS --- Configs/MapirServices-tvOS.plist | 22 + Configs/MapirServices-watchOS.plist | 22 + Configs/MapirServicesTests-tvOS.plist | 22 + MapirServices.podspec | 29 +- MapirServices.xcodeproj/project.pbxproj | 478 +++++++++++++++++- .../xcschemes/MapirServices-iOS.xcscheme | 2 +- .../xcschemes/MapirServices-macOS.xcscheme | 77 +++ .../xcschemes/MapirServices-tvOS.xcscheme | 77 +++ .../xcschemes/MapirServices-watchOS.xcscheme | 67 +++ Sources/MapirServices_tvOS.h | 19 + Sources/MapirServices_watchOS.h | 19 + Tests/MapirServices_macOSTests.swift | 34 -- 12 files changed, 803 insertions(+), 65 deletions(-) create mode 100644 Configs/MapirServices-tvOS.plist create mode 100644 Configs/MapirServices-watchOS.plist create mode 100644 Configs/MapirServicesTests-tvOS.plist create mode 100644 MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-macOS.xcscheme create mode 100644 MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-tvOS.xcscheme create mode 100644 MapirServices.xcodeproj/xcshareddata/xcschemes/MapirServices-watchOS.xcscheme create mode 100644 Sources/MapirServices_tvOS.h create mode 100644 Sources/MapirServices_watchOS.h delete mode 100644 Tests/MapirServices_macOSTests.swift diff --git a/Configs/MapirServices-tvOS.plist b/Configs/MapirServices-tvOS.plist new file mode 100644 index 0000000..9bcb244 --- /dev/null +++ b/Configs/MapirServices-tvOS.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + + diff --git a/Configs/MapirServices-watchOS.plist b/Configs/MapirServices-watchOS.plist new file mode 100644 index 0000000..9bcb244 --- /dev/null +++ b/Configs/MapirServices-watchOS.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + + diff --git a/Configs/MapirServicesTests-tvOS.plist b/Configs/MapirServicesTests-tvOS.plist new file mode 100644 index 0000000..64d65ca --- /dev/null +++ b/Configs/MapirServicesTests-tvOS.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + $(PRODUCT_BUNDLE_PACKAGE_TYPE) + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/MapirServices.podspec b/MapirServices.podspec index 17b30bc..2012ac1 100644 --- a/MapirServices.podspec +++ b/MapirServices.podspec @@ -8,29 +8,24 @@ Pod::Spec.new do |s| 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.source = { :git => "https://github.com/map-ir/ios-sdk-v1-services-beta", :tag => "v#{s.version}" } - s.platform = :ios - s.ios.deployment_target = "10.0" - s.module_name = "MapirServiecs" - - # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + # --- iOS ------------------------------------------------- # - s.source_files = "Sources/**/*.swift" - - # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # + s.platform = :ios + s.ios.deployment_target = '9.0' - s.resources = ['MapirServices/Resources/*/*', 'MapirServices/Resources/*'] + # --- macOS ----------------------------------------------- # + # s.platform = :osx + # s.osx.deployment_target = '10.10' - # ――― 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 c645923..6033269 100644 --- a/MapirServices.xcodeproj/project.pbxproj +++ b/MapirServices.xcodeproj/project.pbxproj @@ -32,7 +32,6 @@ 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 */; }; - C004681E22E5DE2C00CF922E /* MapirServices_macOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C004681422E5DDD100CF922E /* MapirServices_macOSTests.swift */; }; 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 */; }; @@ -69,6 +68,60 @@ 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 */; }; + C05604BB22E737B6004A2F9C /* MapirServices_tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C05604A222E7204F004A2F9C /* MapirServices_tvOS.h */; }; + 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 */; }; + C05604DC22E737B7004A2F9C /* MapirServices_watchOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C056049522E72014004A2F9C /* MapirServices_watchOS.h */; }; + 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 */; }; + C05604F822E737DA004A2F9C /* MapirServicesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3D9C42D722745CDE000A6585 /* MapirServicesTests.swift */; }; 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 */; }; @@ -157,6 +210,13 @@ 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 */ @@ -227,7 +287,6 @@ C004680922E5DDD000CF922E /* MapirServices.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MapirServices.h; sourceTree = ""; }; C004680A22E5DDD000CF922E /* MapirServices-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServices-macOS.plist"; sourceTree = ""; }; C004680F22E5DDD000CF922E /* MapirServices-macOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "MapirServices-macOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - C004681422E5DDD100CF922E /* MapirServices_macOSTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapirServices_macOSTests.swift; sourceTree = ""; }; C004681622E5DDD100CF922E /* MapirServicesTests-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServicesTests-macOS.plist"; sourceTree = ""; }; C02DCF6422CA1C9600BA403F /* MPSWaypoint.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSWaypoint.swift; sourceTree = ""; }; C02DCF6622CA1CE700BA403F /* MPSStep.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MPSStep.swift; sourceTree = ""; }; @@ -239,6 +298,14 @@ 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 = ""; }; 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; }; + C056049522E72014004A2F9C /* MapirServices_watchOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MapirServices_watchOS.h; sourceTree = ""; }; + C056049622E72014004A2F9C /* MapirServices-watchOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServices-watchOS.plist"; sourceTree = ""; }; + C05604A022E7204F004A2F9C /* MapirServices_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + C05604A222E7204F004A2F9C /* MapirServices_tvOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MapirServices_tvOS.h; sourceTree = ""; }; + C05604A322E7204F004A2F9C /* MapirServices-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServices-tvOS.plist"; sourceTree = ""; }; + C05604A822E7204F004A2F9C /* MapirServices-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "MapirServices-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; + C05604AF22E7204F004A2F9C /* MapirServicesTests-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServicesTests-tvOS.plist"; sourceTree = ""; }; 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 = ""; }; @@ -299,6 +366,28 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C056049022E72014004A2F9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056049D22E7204F004A2F9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C05604A522E7204F004A2F9C /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C05604A922E7204F004A2F9C /* MapirServices_tvOS.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -328,6 +417,9 @@ 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 = ""; @@ -336,9 +428,12 @@ isa = PBXGroup; children = ( 3D9C429C227458E8000A6585 /* MapirServices-iOS.plist */, - 3D9C429D227458E8000A6585 /* MapirServicesTests-iOS.plist */, C004680A22E5DDD000CF922E /* MapirServices-macOS.plist */, + C056049622E72014004A2F9C /* MapirServices-watchOS.plist */, + C05604A322E7204F004A2F9C /* MapirServices-tvOS.plist */, + 3D9C429D227458E8000A6585 /* MapirServicesTests-iOS.plist */, C004681622E5DDD100CF922E /* MapirServicesTests-macOS.plist */, + C05604AF22E7204F004A2F9C /* MapirServicesTests-tvOS.plist */, 3D9C42D422745B48000A6585 /* MapirServices.podspec */, 3D9C42D322745B48000A6585 /* Package.swift */, 3D9C42D622745C9D000A6585 /* Fastfile */, @@ -357,6 +452,8 @@ 3D9C42A0227458FA000A6585 /* Sources */ = { isa = PBXGroup; children = ( + C056049522E72014004A2F9C /* MapirServices_watchOS.h */, + C05604A222E7204F004A2F9C /* MapirServices_tvOS.h */, C004680922E5DDD000CF922E /* MapirServices.h */, 3D9C42A122745900000A6585 /* MapirServices.swift */, C04CF66722A27D57009761C4 /* Core */, @@ -371,7 +468,6 @@ children = ( 3D9C42EC22745FDA000A6585 /* LinuxMain.swift */, 3D9C42D722745CDE000A6585 /* MapirServicesTests.swift */, - C004681422E5DDD100CF922E /* MapirServices_macOSTests.swift */, ); path = Tests; sourceTree = ""; @@ -484,6 +580,23 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + C05604F722E737D2004A2F9C /* MapirServices.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056048E22E72014004A2F9C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C05604DC22E737B7004A2F9C /* MapirServices_watchOS.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056049B22E7204F004A2F9C /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + C05604BB22E737B6004A2F9C /* MapirServices_tvOS.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -585,6 +698,60 @@ 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 */, + ); + 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 */, + ); + 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 */ @@ -615,6 +782,15 @@ C035B3EE22DB4F340083BBD4 = { CreatedOnToolsVersion = 11.0; }; + C056049222E72014004A2F9C = { + CreatedOnToolsVersion = 11.0; + }; + C056049F22E7204F004A2F9C = { + CreatedOnToolsVersion = 11.0; + }; + C05604A722E7204F004A2F9C = { + CreatedOnToolsVersion = 11.0; + }; }; }; buildConfigurationList = 3D9C428A22745894000A6585 /* Build configuration list for PBXProject "MapirServices" */; @@ -639,9 +815,12 @@ 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 */, ); @@ -738,6 +917,27 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C056049122E72014004A2F9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C056049E22E7204F004A2F9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + C05604A622E7204F004A2F9C /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -816,7 +1016,6 @@ buildActionMask = 2147483647; files = ( 3D9C42FC22746078000A6585 /* MapirServicesTests.swift in Sources */, - C004681E22E5DE2C00CF922E /* MapirServices_macOSTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -864,6 +1063,77 @@ 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; }; @@ -885,6 +1155,11 @@ target = C004680622E5DDD000CF922E /* MapirServices-macOS */; targetProxy = C004681122E5DDD100CF922E /* PBXContainerItemProxy */; }; + C05604AB22E7204F004A2F9C /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C056049F22E7204F004A2F9C /* MapirServices-tvOS */; + targetProxy = C05604AA22E7204F004A2F9C /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -951,8 +1226,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.10; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -1010,8 +1285,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.10; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; + MACOSX_DEPLOYMENT_TARGET = 10.12; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -1041,7 +1316,7 @@ ); INFOPLIST_FILE = "Configs/MapirServices-iOS.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", @@ -1076,7 +1351,7 @@ ); INFOPLIST_FILE = "Configs/MapirServices-iOS.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", @@ -1177,6 +1452,7 @@ C004681822E5DDD100CF922E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; @@ -1196,7 +1472,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; MARKETING_VERSION = 0.1.0; PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-macOS"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -1210,6 +1486,7 @@ C004681922E5DDD100CF922E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + APPLICATION_EXTENSION_API_ONLY = YES; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; @@ -1229,7 +1506,7 @@ "@executable_path/../Frameworks", "@loader_path/Frameworks", ); - MACOSX_DEPLOYMENT_TARGET = 10.13; + MACOSX_DEPLOYMENT_TARGET = 10.10; MARKETING_VERSION = 0.1.0; PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-macOS"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; @@ -1300,6 +1577,154 @@ }; 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 = "MapirServices-watchOS/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + 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 = 6.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 = "MapirServices-watchOS/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + 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 = 6.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 = "MapirServices-tvOS/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + 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 = 13.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 = "MapirServices-tvOS/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + 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 = 13.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; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -1366,6 +1791,33 @@ 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 = ( + C05604B522E7204F004A2F9C /* Debug */, + C05604B622E7204F004A2F9C /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 3D9C428722745894000A6585 /* Project object */; 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/Sources/MapirServices_tvOS.h b/Sources/MapirServices_tvOS.h new file mode 100644 index 0000000..9802f1d --- /dev/null +++ b/Sources/MapirServices_tvOS.h @@ -0,0 +1,19 @@ +// +// MapirServices_tvOS.h +// MapirServices-tvOS +// +// Created by Alireza Asadi on 1/5/1398 AP. +// Copyright © 1398 AP Map. All rights reserved. +// + +#import + +//! Project version number for MapirServices_tvOS. +FOUNDATION_EXPORT double MapirServices_tvOSVersionNumber; + +//! Project version string for MapirServices_tvOS. +FOUNDATION_EXPORT const unsigned char MapirServices_tvOSVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Sources/MapirServices_watchOS.h b/Sources/MapirServices_watchOS.h new file mode 100644 index 0000000..55c16de --- /dev/null +++ b/Sources/MapirServices_watchOS.h @@ -0,0 +1,19 @@ +// +// MapirServices_watchOS.h +// MapirServices-watchOS +// +// Created by Alireza Asadi on 1/5/1398 AP. +// Copyright © 1398 AP Map. All rights reserved. +// + +#import + +//! Project version number for MapirServices_watchOS. +FOUNDATION_EXPORT double MapirServices_watchOSVersionNumber; + +//! Project version string for MapirServices_watchOS. +FOUNDATION_EXPORT const unsigned char MapirServices_watchOSVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Tests/MapirServices_macOSTests.swift b/Tests/MapirServices_macOSTests.swift deleted file mode 100644 index cb4400a..0000000 --- a/Tests/MapirServices_macOSTests.swift +++ /dev/null @@ -1,34 +0,0 @@ -// -// MapirServices_macOSTests.swift -// MapirServices-macOSTests -// -// Created by Alireza Asadi on 31/4/1398 AP. -// Copyright © 1398 AP Map. All rights reserved. -// - -import XCTest -@testable import MapirServices_macOS - -class MapirServices_macOSTests: XCTestCase { - - override func setUp() { - // Put setup code here. This method is called before the invocation of each test method in the class. - } - - override func tearDown() { - // Put teardown code here. This method is called after the invocation of each test method in the class. - } - - func testExample() { - // This is an example of a functional test case. - // Use XCTAssert and related functions to verify your tests produce the correct results. - } - - func testPerformanceExample() { - // This is an example of a performance test case. - self.measure { - // Put the code you want to measure the time of here. - } - } - -} From 360be1f33561669d4b74eb838f8d836adc4c8945 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 11:39:25 +0430 Subject: [PATCH 05/22] route options and modes updated. --- Sources/Models/Routing/MPSRoute.swift | 36 ++++++++++++++------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/Sources/Models/Routing/MPSRoute.swift b/Sources/Models/Routing/MPSRoute.swift index 720dec4..c9f2a54 100644 --- a/Sources/Models/Routing/MPSRoute.swift +++ b/Sources/Models/Routing/MPSRoute.swift @@ -12,6 +12,25 @@ 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) + } + /// The distance traveled by the route, in `Double` meters. public var distance: Double @@ -62,20 +81,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) -} From 1e5390db0163003a13e7f88d8b3551187e9d547a Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 11:39:54 +0430 Subject: [PATCH 06/22] header files changed. --- Sources/MapirServices.h | 2 -- Sources/MapirServices_tvOS.h | 1 - 2 files changed, 3 deletions(-) diff --git a/Sources/MapirServices.h b/Sources/MapirServices.h index e11eaf9..bfc420d 100644 --- a/Sources/MapirServices.h +++ b/Sources/MapirServices.h @@ -15,5 +15,3 @@ FOUNDATION_EXPORT double MapirServices_macOSVersionNumber; FOUNDATION_EXPORT const unsigned char MapirServices_macOSVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/Sources/MapirServices_tvOS.h b/Sources/MapirServices_tvOS.h index 9802f1d..ed5217f 100644 --- a/Sources/MapirServices_tvOS.h +++ b/Sources/MapirServices_tvOS.h @@ -16,4 +16,3 @@ FOUNDATION_EXPORT const unsigned char MapirServices_tvOSVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - From 53d59b86df12ef3bafa30028a38edf45e2656ffb Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 11:40:54 +0430 Subject: [PATCH 07/22] added support for watchOS and macOS. --- MapirServices.xcodeproj/project.pbxproj | 56 +++++++++++++++++++------ Sources/MapirServices.swift | 2 +- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/MapirServices.xcodeproj/project.pbxproj b/MapirServices.xcodeproj/project.pbxproj index 6033269..cd17ec9 100644 --- a/MapirServices.xcodeproj/project.pbxproj +++ b/MapirServices.xcodeproj/project.pbxproj @@ -70,7 +70,6 @@ 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 */; }; - C05604BB22E737B6004A2F9C /* MapirServices_tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C05604A222E7204F004A2F9C /* MapirServices_tvOS.h */; }; 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 */; }; @@ -95,7 +94,6 @@ 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 */; }; - C05604DC22E737B7004A2F9C /* MapirServices_watchOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C056049522E72014004A2F9C /* MapirServices_watchOS.h */; }; 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 */; }; @@ -120,8 +118,14 @@ 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 */; }; + 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 */; }; + C056051D22E739AD004A2F9C /* MapirServices_tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C05604A222E7204F004A2F9C /* MapirServices_tvOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; + C056051E22E739B9004A2F9C /* MapirServices_watchOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C056049522E72014004A2F9C /* MapirServices_watchOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 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 */; }; @@ -242,6 +246,28 @@ 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; @@ -370,6 +396,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C056051F22E739D5004A2F9C /* Polyline.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -377,6 +404,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C056052222E739D9004A2F9C /* Polyline.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -588,7 +616,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - C05604DC22E737B7004A2F9C /* MapirServices_watchOS.h in Headers */, + C056051E22E739B9004A2F9C /* MapirServices_watchOS.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -596,7 +624,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - C05604BB22E737B6004A2F9C /* MapirServices_tvOS.h in Headers */, + C056051D22E739AD004A2F9C /* MapirServices_tvOS.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -706,6 +734,7 @@ C056048F22E72014004A2F9C /* Sources */, C056049022E72014004A2F9C /* Frameworks */, C056049122E72014004A2F9C /* Resources */, + C056052122E739D5004A2F9C /* Embed Frameworks */, ); buildRules = ( ); @@ -724,6 +753,7 @@ C056049C22E7204F004A2F9C /* Sources */, C056049D22E7204F004A2F9C /* Frameworks */, C056049E22E7204F004A2F9C /* Resources */, + C056052422E739D9004A2F9C /* Embed Frameworks */, ); buildRules = ( ); @@ -1587,7 +1617,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "MapirServices-watchOS/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Configs/MapirServices-watchOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1600,7 +1630,7 @@ SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; - WATCHOS_DEPLOYMENT_TARGET = 6.0; + WATCHOS_DEPLOYMENT_TARGET = 3.0; }; name = Debug; }; @@ -1614,7 +1644,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "MapirServices-watchOS/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Configs/MapirServices-watchOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1627,7 +1657,7 @@ SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 4; - WATCHOS_DEPLOYMENT_TARGET = 6.0; + WATCHOS_DEPLOYMENT_TARGET = 3.0; }; name = Release; }; @@ -1640,7 +1670,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "MapirServices-tvOS/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Configs/MapirServices-tvOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1653,7 +1683,7 @@ SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 13.0; + TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; }; @@ -1666,7 +1696,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "MapirServices-tvOS/Info.plist"; + INFOPLIST_FILE = "$(SRCROOT)/Configs/MapirServices-tvOS.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1679,7 +1709,7 @@ SKIP_INSTALL = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 13.0; + TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Release; }; diff --git a/Sources/MapirServices.swift b/Sources/MapirServices.swift index 02cf585..1aab3af 100644 --- a/Sources/MapirServices.swift +++ b/Sources/MapirServices.swift @@ -517,7 +517,7 @@ public class MPSMapirServices { dataTask.resume() } - #if os(iOS) + #if os(iOS) || os(watchOS) || os(tvOS) /// Generates static map of an area of the map. /// /// - Parameter center: Center point of the map. From 2d47b1fae4adab1385f4b4a1710baee3063fbe98 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 11:52:01 +0430 Subject: [PATCH 08/22] Maneuver type and modifier moved into the MPSManeuver struct. --- Sources/Models/Routing/MPSManeuver.swift | 187 ++++++++++++----------- 1 file changed, 94 insertions(+), 93 deletions(-) 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 -} From 4a00032654f2903778ba2118f6bf5a4170b98c85 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 12:09:09 +0430 Subject: [PATCH 09/22] distance property added to waypoint object. --- Sources/Models/Routing/MPSWaypoint.swift | 5 +++++ 1 file changed, 5 insertions(+) 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 { From e9b0b145c263769845094bfb8550bca0a5c2366a Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 13:31:55 +0430 Subject: [PATCH 10/22] Lane indications moved in Lane object. --- Sources/Models/Routing/MPSLane.swift | 64 ++++++++++++++-------------- 1 file changed, 32 insertions(+), 32 deletions(-) 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 -} From a6f6b95f5c593b119147d4ef6b82ce28bba926b2 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 18:27:51 +0430 Subject: [PATCH 11/22] changed schemes to use same plist file. --- Configs/MapirServices-macOS.plist | 24 ------------------- Configs/MapirServices-tvOS.plist | 22 ----------------- Configs/MapirServices-watchOS.plist | 22 ----------------- ...Services-iOS.plist => MapirServices.plist} | 0 Configs/MapirServicesTests-macOS.plist | 22 ----------------- Configs/MapirServicesTests-tvOS.plist | 22 ----------------- ...sts-iOS.plist => MapirServicesTests.plist} | 0 7 files changed, 112 deletions(-) delete mode 100644 Configs/MapirServices-macOS.plist delete mode 100644 Configs/MapirServices-tvOS.plist delete mode 100644 Configs/MapirServices-watchOS.plist rename Configs/{MapirServices-iOS.plist => MapirServices.plist} (100%) delete mode 100644 Configs/MapirServicesTests-macOS.plist delete mode 100644 Configs/MapirServicesTests-tvOS.plist rename Configs/{MapirServicesTests-iOS.plist => MapirServicesTests.plist} (100%) diff --git a/Configs/MapirServices-macOS.plist b/Configs/MapirServices-macOS.plist deleted file mode 100644 index 8e831a1..0000000 --- a/Configs/MapirServices-macOS.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - $(MARKETING_VERSION) - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSHumanReadableCopyright - Copyright © 1398 AP Map. All rights reserved. - - diff --git a/Configs/MapirServices-tvOS.plist b/Configs/MapirServices-tvOS.plist deleted file mode 100644 index 9bcb244..0000000 --- a/Configs/MapirServices-tvOS.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - - diff --git a/Configs/MapirServices-watchOS.plist b/Configs/MapirServices-watchOS.plist deleted file mode 100644 index 9bcb244..0000000 --- a/Configs/MapirServices-watchOS.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - - diff --git a/Configs/MapirServices-iOS.plist b/Configs/MapirServices.plist similarity index 100% rename from Configs/MapirServices-iOS.plist rename to Configs/MapirServices.plist diff --git a/Configs/MapirServicesTests-macOS.plist b/Configs/MapirServicesTests-macOS.plist deleted file mode 100644 index 64d65ca..0000000 --- a/Configs/MapirServicesTests-macOS.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/Configs/MapirServicesTests-tvOS.plist b/Configs/MapirServicesTests-tvOS.plist deleted file mode 100644 index 64d65ca..0000000 --- a/Configs/MapirServicesTests-tvOS.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - - diff --git a/Configs/MapirServicesTests-iOS.plist b/Configs/MapirServicesTests.plist similarity index 100% rename from Configs/MapirServicesTests-iOS.plist rename to Configs/MapirServicesTests.plist From 04ad65b3707039323cab0e4c1cb58e51ed11431e Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 18:28:09 +0430 Subject: [PATCH 12/22] changed files to use same header file. --- Sources/MapirServices.h | 11 ++++++----- Sources/MapirServices_tvOS.h | 18 ------------------ Sources/MapirServices_watchOS.h | 19 ------------------- 3 files changed, 6 insertions(+), 42 deletions(-) delete mode 100644 Sources/MapirServices_tvOS.h delete mode 100644 Sources/MapirServices_watchOS.h diff --git a/Sources/MapirServices.h b/Sources/MapirServices.h index bfc420d..f50f0db 100644 --- a/Sources/MapirServices.h +++ b/Sources/MapirServices.h @@ -6,12 +6,13 @@ // Copyright © 1398 AP Map. All rights reserved. // -#import +#import +#import -//! Project version number for MapirServices_macOS. -FOUNDATION_EXPORT double MapirServices_macOSVersionNumber; +//! Project version number for MapirServices. +FOUNDATION_EXPORT double MapirServicesVersionNumber; -//! Project version string for MapirServices_macOS. -FOUNDATION_EXPORT const unsigned char MapirServices_macOSVersionString[]; +//! 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_tvOS.h b/Sources/MapirServices_tvOS.h deleted file mode 100644 index ed5217f..0000000 --- a/Sources/MapirServices_tvOS.h +++ /dev/null @@ -1,18 +0,0 @@ -// -// MapirServices_tvOS.h -// MapirServices-tvOS -// -// Created by Alireza Asadi on 1/5/1398 AP. -// Copyright © 1398 AP Map. All rights reserved. -// - -#import - -//! Project version number for MapirServices_tvOS. -FOUNDATION_EXPORT double MapirServices_tvOSVersionNumber; - -//! Project version string for MapirServices_tvOS. -FOUNDATION_EXPORT const unsigned char MapirServices_tvOSVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - diff --git a/Sources/MapirServices_watchOS.h b/Sources/MapirServices_watchOS.h deleted file mode 100644 index 55c16de..0000000 --- a/Sources/MapirServices_watchOS.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// MapirServices_watchOS.h -// MapirServices-watchOS -// -// Created by Alireza Asadi on 1/5/1398 AP. -// Copyright © 1398 AP Map. All rights reserved. -// - -#import - -//! Project version number for MapirServices_watchOS. -FOUNDATION_EXPORT double MapirServices_watchOSVersionNumber; - -//! Project version string for MapirServices_watchOS. -FOUNDATION_EXPORT const unsigned char MapirServices_watchOSVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - From 87ca6d9d2f0a586e325754d95c48826745694e56 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 18:28:50 +0430 Subject: [PATCH 13/22] project updated to have same plist file for all schemes. --- MapirServices.xcodeproj/project.pbxproj | 48 ++++++++++--------------- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/MapirServices.xcodeproj/project.pbxproj b/MapirServices.xcodeproj/project.pbxproj index cd17ec9..cc730f1 100644 --- a/MapirServices.xcodeproj/project.pbxproj +++ b/MapirServices.xcodeproj/project.pbxproj @@ -120,8 +120,6 @@ 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 */; }; - C056051D22E739AD004A2F9C /* MapirServices_tvOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C05604A222E7204F004A2F9C /* MapirServices_tvOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; - C056051E22E739B9004A2F9C /* MapirServices_watchOS.h in Headers */ = {isa = PBXBuildFile; fileRef = C056049522E72014004A2F9C /* MapirServices_watchOS.h */; settings = {ATTRIBUTES = (Public, ); }; }; 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 */; }; @@ -140,6 +138,9 @@ C0EA4FE122C9EE2600BC04EF /* MPSSearchResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = C0EA4FE022C9EE2600BC04EF /* MPSSearchResult.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 */ @@ -283,8 +284,8 @@ /* Begin PBXFileReference section */ 3D9C429022745894000A6585 /* MapirServices.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 3D9C429C227458E8000A6585 /* MapirServices-iOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MapirServices-iOS.plist"; sourceTree = ""; }; - 3D9C429D227458E8000A6585 /* MapirServicesTests-iOS.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "MapirServicesTests-iOS.plist"; sourceTree = ""; }; + 3D9C429C227458E8000A6585 /* MapirServices.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = MapirServices.plist; sourceTree = ""; }; + 3D9C429D227458E8000A6585 /* MapirServicesTests.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = MapirServicesTests.plist; sourceTree = ""; }; 3D9C42A122745900000A6585 /* MapirServices.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapirServices.swift; sourceTree = ""; }; 3D9C42A92274599D000A6585 /* MapirServices.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 3D9C42B7227459D6000A6585 /* MapirServices.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices.framework; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -311,9 +312,7 @@ 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 = ""; }; - C004680A22E5DDD000CF922E /* MapirServices-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServices-macOS.plist"; sourceTree = ""; }; C004680F22E5DDD000CF922E /* MapirServices-macOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "MapirServices-macOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - C004681622E5DDD100CF922E /* MapirServicesTests-macOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServicesTests-macOS.plist"; sourceTree = ""; }; 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 = ""; }; @@ -325,13 +324,8 @@ C04CF66822A27D6E009761C4 /* HTTPMethod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HTTPMethod.swift; 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; }; - C056049522E72014004A2F9C /* MapirServices_watchOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MapirServices_watchOS.h; sourceTree = ""; }; - C056049622E72014004A2F9C /* MapirServices-watchOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServices-watchOS.plist"; sourceTree = ""; }; C05604A022E7204F004A2F9C /* MapirServices_tvOS.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MapirServices_tvOS.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - C05604A222E7204F004A2F9C /* MapirServices_tvOS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MapirServices_tvOS.h; sourceTree = ""; }; - C05604A322E7204F004A2F9C /* MapirServices-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServices-tvOS.plist"; sourceTree = ""; }; C05604A822E7204F004A2F9C /* MapirServices-tvOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "MapirServices-tvOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; - C05604AF22E7204F004A2F9C /* MapirServicesTests-tvOS.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MapirServicesTests-tvOS.plist"; sourceTree = ""; }; 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 = ""; }; @@ -455,13 +449,8 @@ 3D9C429B227458E8000A6585 /* Configs */ = { isa = PBXGroup; children = ( - 3D9C429C227458E8000A6585 /* MapirServices-iOS.plist */, - C004680A22E5DDD000CF922E /* MapirServices-macOS.plist */, - C056049622E72014004A2F9C /* MapirServices-watchOS.plist */, - C05604A322E7204F004A2F9C /* MapirServices-tvOS.plist */, - 3D9C429D227458E8000A6585 /* MapirServicesTests-iOS.plist */, - C004681622E5DDD100CF922E /* MapirServicesTests-macOS.plist */, - C05604AF22E7204F004A2F9C /* MapirServicesTests-tvOS.plist */, + 3D9C429C227458E8000A6585 /* MapirServices.plist */, + 3D9C429D227458E8000A6585 /* MapirServicesTests.plist */, 3D9C42D422745B48000A6585 /* MapirServices.podspec */, 3D9C42D322745B48000A6585 /* Package.swift */, 3D9C42D622745C9D000A6585 /* Fastfile */, @@ -480,8 +469,6 @@ 3D9C42A0227458FA000A6585 /* Sources */ = { isa = PBXGroup; children = ( - C056049522E72014004A2F9C /* MapirServices_watchOS.h */, - C05604A222E7204F004A2F9C /* MapirServices_tvOS.h */, C004680922E5DDD000CF922E /* MapirServices.h */, 3D9C42A122745900000A6585 /* MapirServices.swift */, C04CF66722A27D57009761C4 /* Core */, @@ -601,6 +588,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( + C0FA897122E899A4003EB4E3 /* MapirServices.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -616,7 +604,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - C056051E22E739B9004A2F9C /* MapirServices_watchOS.h in Headers */, + C0FA897022E899A4003EB4E3 /* MapirServices.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -624,7 +612,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - C056051D22E739AD004A2F9C /* MapirServices_tvOS.h in Headers */, + C0FA896822E899A3003EB4E3 /* MapirServices.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1344,7 +1332,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); - INFOPLIST_FILE = "Configs/MapirServices-iOS.plist"; + INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -1379,7 +1367,7 @@ "$(inherited)", "$(PROJECT_DIR)/Carthage/Build/iOS", ); - INFOPLIST_FILE = "Configs/MapirServices-iOS.plist"; + INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; IPHONEOS_DEPLOYMENT_TARGET = 9.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -1495,7 +1483,7 @@ "$(PROJECT_DIR)/Carthage/Build/iOS", ); FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "Configs/MapirServices-macOS.plist"; + INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1529,7 +1517,7 @@ "$(PROJECT_DIR)/Carthage/Build/iOS", ); FRAMEWORK_VERSION = A; - INFOPLIST_FILE = "Configs/MapirServices-macOS.plist"; + INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1617,7 +1605,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/Configs/MapirServices-watchOS.plist"; + INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1644,7 +1632,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/Configs/MapirServices-watchOS.plist"; + INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1670,7 +1658,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/Configs/MapirServices-tvOS.plist"; + INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -1696,7 +1684,7 @@ DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; - INFOPLIST_FILE = "$(SRCROOT)/Configs/MapirServices-tvOS.plist"; + INFOPLIST_FILE = Configs/MapirServices.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", From faea32aed7dd84839704848fb96aa77ff56a374c Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 18:29:18 +0430 Subject: [PATCH 14/22] cleared playground file. --- .../Contents.swift | 30 ------------------- 1 file changed, 30 deletions(-) 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)") -// } -// } -//} - From 4454076e914422b1166a5730f4770b24283b8173 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 18:29:59 +0430 Subject: [PATCH 15/22] steps added to routing options. --- Sources/Models/Routing/MPSRoute.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/Models/Routing/MPSRoute.swift b/Sources/Models/Routing/MPSRoute.swift index c9f2a54..22514c6 100644 --- a/Sources/Models/Routing/MPSRoute.swift +++ b/Sources/Models/Routing/MPSRoute.swift @@ -29,6 +29,7 @@ public struct MPSRoute { 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. From 5d91f9536c95b424aafbc16f6df528e0e0a00a83 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 18:31:58 +0430 Subject: [PATCH 16/22] imports updated. user agents added to request headers. method of creating urls and query parts of them updated. --- Sources/MapirServices.swift | 224 ++++++++++++++++++++++-------------- 1 file changed, 137 insertions(+), 87 deletions(-) diff --git a/Sources/MapirServices.swift b/Sources/MapirServices.swift index 1aab3af..7c65b2c 100644 --- a/Sources/MapirServices.swift +++ b/Sources/MapirServices.swift @@ -10,7 +10,7 @@ @_exported import Foundation import CoreLocation -#if os(iOS) +#if os(iOS) || os(watchOS) || os(tvOS) import UIKit #elseif os(macOS) import AppKit @@ -25,8 +25,8 @@ public class MPSMapirServices { 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" @@ -35,7 +35,7 @@ public class MPSMapirServices { /// 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? @@ -53,19 +53,73 @@ 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.ServiceError.invalidAccessToken } request.addValue("application/json", forHTTPHeaderField: "Content-Type") + request.addValue(self.userAgent, forHTTPHeaderField: "User-Agent") return request } @@ -82,11 +136,12 @@ public class MPSMapirServices { public func reverseGeocode(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, httpMethod: HTTPMethod.get) + request = try urlRequest(withPath: Endpoint.reverseGeocode, queryItems: queryItems, httpMethod: HTTPMethod.get) } catch let requestError { completionHandler(.failure(requestError)) return @@ -136,12 +191,13 @@ public class MPSMapirServices { 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)) @@ -200,44 +256,41 @@ public class MPSMapirServices { options: MPSDistanceMatrixOptions = [], completionHandler: @escaping (_ result: Result) -> Void) { - var query: String = "?" - query += "origins=" + 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 @@ -299,9 +352,9 @@ public class MPSMapirServices { 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 @@ -371,9 +424,9 @@ public class MPSMapirServices { 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 @@ -440,41 +493,46 @@ public class MPSMapirServices { /// [OSRM documentation](http://project-osrm.org/docs/v5.22.0/api/?language=Swift#general-options). public func route(from origin: CLLocationCoordinate2D, to destinations: CLLocationCoordinate2D..., - routeType: MPSRouteType, - routeOptions: MPSRouteOptions = [], - completionHandler: @escaping (_ result: Result) -> Void) { + 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 @@ -531,27 +589,22 @@ public class MPSMapirServices { markers: [MPSStaticMapMarker] = [], completionHandler: @escaping (_ result: Result) -> Void) { - guard !markers.isEmpty else { - completionHandler(.failure(MPSError.RequestError.invalidArgument)) - return - } - - var query = "?width=\(Int(size.width))&height=\(Int(size.height))&zoom_level=\(zoomLevel)" - - for marker in markers { - query += "&markers=color:\(marker.style.rawValue)|label:\(marker.label)|\(marker.coordinate.longitude),\(marker.coordinate.latitude)" - } + var queryItems = [URLQueryItem(name: "width", value: "\(Int(size.width))"), + URLQueryItem(name: "height", value: "\(Int(size.height))"), + URLQueryItem(name: "zoom_level", value: "\(zoomLevel))")] - guard let urlEncodedQuery = query.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { - completionHandler(.failure(MPSError.urlEncodingError)) - return + 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 @@ -606,33 +659,28 @@ public class MPSMapirServices { markers: [MPSStaticMapMarker] = [], completionHandler: @escaping (_ result: Result) -> Void) { - guard !markers.isEmpty else { - completionHandler(.failure(MPSError.RequestError.invalidArgument)) - return - } - - var query = "?width=\(Int(size.width))&height=\(Int(size.height))&zoom_level=\(zoomLevel)" + var queryItems = [URLQueryItem(name: "width", value: "\(Int(size.width))"), + URLQueryItem(name: "height", value: "\(Int(size.height))"), + URLQueryItem(name: "zoom_level", value: "\(zoomLevel))")] - for marker in markers { - query += "&markers=color:\(marker.style.rawValue)|label:\(marker.label)|\(marker.coordinate.longitude),\(marker.coordinate.latitude)" - } - - guard let urlEncodedQuery = query.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) else { - completionHandler(.failure(MPSError.urlEncodingError)) - return + 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 @@ -662,7 +710,9 @@ public class MPSMapirServices { default: return } - }.resume() + } + + dataTask.resume() } #endif } From 5cd24d96ae09b63084463490abe968795e26cd65 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 18:32:38 +0430 Subject: [PATCH 17/22] return type of route object updated. --- Sources/MapirServices.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Sources/MapirServices.swift b/Sources/MapirServices.swift index 7c65b2c..bd82df0 100644 --- a/Sources/MapirServices.swift +++ b/Sources/MapirServices.swift @@ -555,7 +555,11 @@ public class MPSMapirServices { if let data = data { do { let decodedData = try self.decoder.decode(MPSRouteResult.self, from: data) - DispatchQueue.main.async { completionHandler(.success(decodedData)) } + DispatchQueue.main.async { + completionHandler(.success( + (decodedData.waypoints, decodedData.routes) + )) + } } catch let decoderError { DispatchQueue.main.async { completionHandler(.failure(decoderError)) } return @@ -642,7 +646,7 @@ public class MPSMapirServices { } } - dataTask.resume() + dataTask.resume() } #elseif os(macOS) From 52b33398e6a1f38b676cf127318b5b9a69a770e6 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 18:37:06 +0430 Subject: [PATCH 18/22] renamed fastReverseGeocode method. --- Sources/MapirServices.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MapirServices.swift b/Sources/MapirServices.swift index bd82df0..fd7f2dc 100644 --- a/Sources/MapirServices.swift +++ b/Sources/MapirServices.swift @@ -188,7 +188,7 @@ public class MPSMapirServices { /// - 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, + public func fastReverseGeocode(for point: CLLocationCoordinate2D, completionHandler: @escaping (_ result: Result) -> Void) { let queryItems = [URLQueryItem(name: "lat", value: "\(point.latitude)"), From f042c243a63bbfdb9c1c53fd9e1e91bfe6ebdd61 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 18:39:49 +0430 Subject: [PATCH 19/22] argument type reseted to the previous style. --- Sources/MapirServices.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/MapirServices.swift b/Sources/MapirServices.swift index fd7f2dc..1a880e9 100644 --- a/Sources/MapirServices.swift +++ b/Sources/MapirServices.swift @@ -492,7 +492,7 @@ public class MPSMapirServices { /// 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..., + to destinations: [CLLocationCoordinate2D], routeMode: MPSRoute.Mode, routeOptions: MPSRoute.Options = [], completionHandler: @escaping (_ result: Result<([MPSWaypoint], [MPSRoute]), Error>) -> Void) { From e8932dbbd83abed00e11d43a36e17fc4ff36cf54 Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Wed, 24 Jul 2019 20:35:01 +0430 Subject: [PATCH 20/22] examples are updated to the latest version. static map not working. --- Example/ViewController.swift | 47 ++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 23 deletions(-) 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 From 0323a3b3c3eb3163653779cb5020049e663cc84d Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Sat, 27 Jul 2019 09:56:21 +0430 Subject: [PATCH 21/22] Distance matrix options moved into MPSDistanceMatrix. --- Sources/MapirServices.swift | 2 +- Sources/Models/MPSDistanceMatrix.swift | 27 +++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Sources/MapirServices.swift b/Sources/MapirServices.swift index 1a880e9..1aa5485 100644 --- a/Sources/MapirServices.swift +++ b/Sources/MapirServices.swift @@ -253,7 +253,7 @@ public class MPSMapirServices { /// 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: MPSDistanceMatrixOptions = [], + options: MPSDistanceMatrix.Options = [], completionHandler: @escaping (_ result: Result) -> Void) { var queryItems: [URLQueryItem] = [] 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) -} From 38e866ee1270907bb4fac26d544ddd277e06999e Mon Sep 17 00:00:00 2001 From: Alireza Asadi Date: Sat, 27 Jul 2019 14:40:54 +0430 Subject: [PATCH 22/22] updated version and .podspec and getting ready for release. --- Example/Resources/Info.plist | 2 - MapirServices.podspec | 24 ++++-- MapirServices.xcodeproj/project.pbxproj | 109 +++--------------------- 3 files changed, 31 insertions(+), 104 deletions(-) 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/MapirServices.podspec b/MapirServices.podspec index 2012ac1..f99b6ea 100644 --- a/MapirServices.podspec +++ b/MapirServices.podspec @@ -1,23 +1,33 @@ 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 => "v#{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 } # --- iOS ------------------------------------------------- # - - s.platform = :ios s.ios.deployment_target = '9.0' + s.ios.framework = 'UIKit' # --- macOS ----------------------------------------------- # - # s.platform = :osx - # s.osx.deployment_target = '10.10' + s.osx.deployment_target = '10.10' + s.osx.framework = 'AppKit' + + # --- watchOS --------------------------------------------- # + s.watchos.deployment_target = '3.0' + s.watchos.framework = 'UIKit' + + # --- tvOS ------------------------------------------------ # + s.tvos.deployment_target = '9.0' + s.tvos.framework = 'UIKit' s.requires_arc = true s.module_name = "MapirServiecs" diff --git a/MapirServices.xcodeproj/project.pbxproj b/MapirServices.xcodeproj/project.pbxproj index cc730f1..9cc831f 100644 --- a/MapirServices.xcodeproj/project.pbxproj +++ b/MapirServices.xcodeproj/project.pbxproj @@ -6,21 +6,6 @@ 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 */; }; @@ -797,9 +782,6 @@ C004680E22E5DDD000CF922E = { CreatedOnToolsVersion = 11.0; }; - C035B3EE22DB4F340083BBD4 = { - CreatedOnToolsVersion = 11.0; - }; C056049222E72014004A2F9C = { CreatedOnToolsVersion = 11.0; }; @@ -840,7 +822,6 @@ C004680E22E5DDD000CF922E /* MapirServices-macOSTests */, C05604A722E7204F004A2F9C /* MapirServices-tvOSTests */, 3D9C43202274629B000A6585 /* Example */, - C035B3EE22DB4F340083BBD4 /* UniversalBinary */, ); }; /* End PBXProject section */ @@ -958,45 +939,6 @@ }; /* End PBXResourcesBuildPhase section */ -/* Begin PBXShellScriptBuildPhase section */ - C035B3F222DB4F530083BBD4 /* Build Process */ = { - isa = PBXShellScriptBuildPhase; - 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; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - name = SwiftLint; - outputFileListPaths = ( - ); - outputPaths = ( - ); - 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 */ - /* Begin PBXSourcesBuildPhase section */ 3D9C428C22745894000A6585 /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -1244,8 +1186,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - MACOSX_DEPLOYMENT_TARGET = 10.12; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -1303,8 +1245,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 10.0; - MACOSX_DEPLOYMENT_TARGET = 10.12; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -1340,7 +1282,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 0.1.0; + MARKETING_VERSION = 0.2.0; PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.MapirServices-iOS"; PRODUCT_NAME = MapirServices; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1375,7 +1317,7 @@ "@executable_path/Frameworks", "@loader_path/Frameworks", ); - MARKETING_VERSION = 0.1.0; + MARKETING_VERSION = 0.2.0; PRODUCT_BUNDLE_IDENTIFIER = "ir.Map.MapirServices-iOS"; PRODUCT_NAME = MapirServices; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1435,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 = ""; @@ -1458,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 = ""; @@ -1491,7 +1433,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.10; - MARKETING_VERSION = 0.1.0; + MARKETING_VERSION = 0.2.0; PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-macOS"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1525,7 +1467,7 @@ "@loader_path/Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 10.10; - MARKETING_VERSION = 0.1.0; + MARKETING_VERSION = 0.2.0; PRODUCT_BUNDLE_IDENTIFIER = "ir.map.MapirServices-macOS"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1577,24 +1519,6 @@ }; name = Release; }; - C035B3EF22DB4F350083BBD4 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 33DVPZ7L7T; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - C035B3F022DB4F350083BBD4 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = 33DVPZ7L7T; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; C056049922E72014004A2F9C /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1612,6 +1536,7 @@ "@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; @@ -1639,6 +1564,7 @@ "@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; @@ -1665,6 +1591,7 @@ "@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; @@ -1691,6 +1618,7 @@ "@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; @@ -1800,15 +1728,6 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C035B3F122DB4F350083BBD4 /* Build configuration list for PBXAggregateTarget "UniversalBinary" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C035B3EF22DB4F350083BBD4 /* Debug */, - C035B3F022DB4F350083BBD4 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; C056049822E72014004A2F9C /* Build configuration list for PBXNativeTarget "MapirServices-watchOS" */ = { isa = XCConfigurationList; buildConfigurations = (