diff --git a/Navigation-Examples.xcodeproj/project.pbxproj b/Navigation-Examples.xcodeproj/project.pbxproj index 30a3a66e..388bad0b 100644 --- a/Navigation-Examples.xcodeproj/project.pbxproj +++ b/Navigation-Examples.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 48; + objectVersion = 52; objects = { /* Begin PBXBuildFile section */ @@ -14,7 +14,6 @@ 2B521D522409242A00984CF8 /* CustomBottomBannerView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 2B521D512409242A00984CF8 /* CustomBottomBannerView.xib */; }; 2B5470632816C74A0068DA3F /* Custom-RoutingProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2B5470622816C74A0068DA3F /* Custom-RoutingProvider.swift */; }; 3B39AC1128CB6F7F0052A80E /* History-Recording.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3B39AC1028CB6F7F0052A80E /* History-Recording.swift */; }; - 6CD94175657B369FB9C6B8B5 /* Pods_DocsCode.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9107365E41DB56AF5F37BEE2 /* Pods_DocsCode.framework */; }; 8A0B182326553482005107DE /* CustomSegue.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8A0B182226553482005107DE /* CustomSegue.storyboard */; }; 8A2DFA57261650A60034A87E /* CustomCameraStateTransition.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A2DFA55261650A60034A87E /* CustomCameraStateTransition.swift */; }; 8A2DFA58261650A60034A87E /* CustomViewportDataSource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8A2DFA56261650A60034A87E /* CustomViewportDataSource.swift */; }; @@ -26,7 +25,6 @@ 8AC9129D2494106100B6941E /* Route-Initialization.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AC9129C2494106100B6941E /* Route-Initialization.swift */; }; 8AE033222628EDFF000E7145 /* Route-Lines-Styling.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8AE033212628EDFF000E7145 /* Route-Lines-Styling.swift */; }; 8DF510741FEB08F70049DB9C /* Embedded-Navigation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8DF510731FEB08F70049DB9C /* Embedded-Navigation.swift */; }; - 8DF510751FEB0CA00049DB9C /* MapboxNavigation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8DF510761FEB0CA00049DB9C /* MapboxNavigation.framework */; }; 9613F58522E0306500D34E24 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 961FC4E822E0260A00C72877 /* Assets.xcassets */; }; 9613F58822E030AC00D34E24 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9613F58622E030AC00D34E24 /* LaunchScreen.storyboard */; }; 9613F58922E030AC00D34E24 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9613F58722E030AC00D34E24 /* Main.storyboard */; }; @@ -52,11 +50,11 @@ C5C0D63820589422003A3B1D /* Custom-Server.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5C0D63720589422003A3B1D /* Custom-Server.swift */; }; C5F130A01FE9B44600463E86 /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5F1309F1FE9B44600463E86 /* Constants.swift */; }; C5F130A61FEB2D7800463E86 /* Advanced.swift in Sources */ = {isa = PBXBuildFile; fileRef = C5F130A51FEB2D7800463E86 /* Advanced.swift */; }; - CC6D97FED3D0CBEF7CA47168 /* Pods_Navigation_Examples.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8592DC8F0A49F0C2214E1AC /* Pods_Navigation_Examples.framework */; }; + FCE40785292CF2FD000CFEC3 /* MapboxCoreNavigation in Frameworks */ = {isa = PBXBuildFile; productRef = FCE40784292CF2FD000CFEC3 /* MapboxCoreNavigation */; }; + FCE40787292CF2FD000CFEC3 /* MapboxNavigation in Frameworks */ = {isa = PBXBuildFile; productRef = FCE40786292CF2FD000CFEC3 /* MapboxNavigation */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ - 0544DEF056F7B94F491CBD53 /* Pods-Navigation-Examples.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Navigation-Examples.release.xcconfig"; path = "Target Support Files/Pods-Navigation-Examples/Pods-Navigation-Examples.release.xcconfig"; sourceTree = ""; }; 11B6E81626176F3600872E4D /* Upcoming-Intersection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Upcoming-Intersection.swift"; sourceTree = ""; }; 11DC36F126161DAF0042CD4A /* Location-Snapping.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Location-Snapping.swift"; sourceTree = ""; }; 2B521D4D24090A3A00984CF8 /* CustomBarsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomBarsViewController.swift; sourceTree = ""; }; @@ -64,7 +62,6 @@ 2B521D512409242A00984CF8 /* CustomBottomBannerView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CustomBottomBannerView.xib; sourceTree = ""; }; 2B5470622816C74A0068DA3F /* Custom-RoutingProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Custom-RoutingProvider.swift"; sourceTree = ""; }; 3B39AC1028CB6F7F0052A80E /* History-Recording.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "History-Recording.swift"; sourceTree = ""; }; - 751C9DE4E717073D370EB4EF /* Pods-DocsCode.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DocsCode.release.xcconfig"; path = "Target Support Files/Pods-DocsCode/Pods-DocsCode.release.xcconfig"; sourceTree = ""; }; 8A0B182226553482005107DE /* CustomSegue.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = CustomSegue.storyboard; sourceTree = ""; }; 8A2DFA55261650A60034A87E /* CustomCameraStateTransition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomCameraStateTransition.swift; sourceTree = ""; }; 8A2DFA56261650A60034A87E /* CustomViewportDataSource.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CustomViewportDataSource.swift; sourceTree = ""; }; @@ -79,7 +76,6 @@ 8D6D36A620001F0400C2B61B /* EmbeddedExamples.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = EmbeddedExamples.storyboard; sourceTree = ""; }; 8DF510731FEB08F70049DB9C /* Embedded-Navigation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Embedded-Navigation.swift"; sourceTree = ""; }; 8DF510761FEB0CA00049DB9C /* MapboxNavigation.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = MapboxNavigation.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 9107365E41DB56AF5F37BEE2 /* Pods_DocsCode.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_DocsCode.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 9613F58622E030AC00D34E24 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 9613F58722E030AC00D34E24 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = ""; }; 961FC4E722E0260A00C72877 /* DocsCode-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DocsCode-Bridging-Header.h"; sourceTree = ""; }; @@ -88,7 +84,6 @@ 961FC4F122E0260A00C72877 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 961FC4F222E0260A00C72877 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 961FC4FE22E0265300C72877 /* DocsCode.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DocsCode.app; sourceTree = BUILT_PRODUCTS_DIR; }; - A8D998B34DD96F479CF96712 /* Pods-DocsCode.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-DocsCode.debug.xcconfig"; path = "Target Support Files/Pods-DocsCode/Pods-DocsCode.debug.xcconfig"; sourceTree = ""; }; B480E423261E4C3500C16FA0 /* Predictive-Caching.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Predictive-Caching.swift"; sourceTree = ""; }; B480E427261E4C4600C16FA0 /* Route-Alerts.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Route-Alerts.swift"; sourceTree = ""; }; B4F805ED26791AD900D5F1C8 /* Custom-User-Location.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Custom-User-Location.swift"; sourceTree = ""; }; @@ -111,8 +106,6 @@ C5C0D63720589422003A3B1D /* Custom-Server.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Custom-Server.swift"; sourceTree = ""; }; C5F1309F1FE9B44600463E86 /* Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = ""; }; C5F130A51FEB2D7800463E86 /* Advanced.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Advanced.swift; sourceTree = ""; }; - C8592DC8F0A49F0C2214E1AC /* Pods_Navigation_Examples.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Navigation_Examples.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - E4F99A65CCB2B9CB623270EE /* Pods-Navigation-Examples.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Navigation-Examples.debug.xcconfig"; path = "Target Support Files/Pods-Navigation-Examples/Pods-Navigation-Examples.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -120,7 +113,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 6CD94175657B369FB9C6B8B5 /* Pods_DocsCode.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -128,8 +120,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 8DF510751FEB0CA00049DB9C /* MapboxNavigation.framework in Frameworks */, - CC6D97FED3D0CBEF7CA47168 /* Pods_Navigation_Examples.framework in Frameworks */, + FCE40785292CF2FD000CFEC3 /* MapboxCoreNavigation in Frameworks */, + FCE40787292CF2FD000CFEC3 /* MapboxNavigation in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -203,17 +195,6 @@ path = NavigationTutorial; sourceTree = ""; }; - A15B2D49443615EF14D2EDD7 /* Pods */ = { - isa = PBXGroup; - children = ( - A8D998B34DD96F479CF96712 /* Pods-DocsCode.debug.xcconfig */, - 751C9DE4E717073D370EB4EF /* Pods-DocsCode.release.xcconfig */, - E4F99A65CCB2B9CB623270EE /* Pods-Navigation-Examples.debug.xcconfig */, - 0544DEF056F7B94F491CBD53 /* Pods-Navigation-Examples.release.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; C58FB84D1FE899B800C4B491 = { isa = PBXGroup; children = ( @@ -222,7 +203,6 @@ 8A5BBF6A2489B0A000FA4960 /* Scripts */, C58FB8571FE899B800C4B491 /* Products */, DE25A5BE57093A8DAF382733 /* Frameworks */, - A15B2D49443615EF14D2EDD7 /* Pods */, ); sourceTree = ""; }; @@ -289,8 +269,6 @@ isa = PBXGroup; children = ( 8DF510761FEB0CA00049DB9C /* MapboxNavigation.framework */, - 9107365E41DB56AF5F37BEE2 /* Pods_DocsCode.framework */, - C8592DC8F0A49F0C2214E1AC /* Pods_Navigation_Examples.framework */, ); name = Frameworks; sourceTree = ""; @@ -302,13 +280,11 @@ isa = PBXNativeTarget; buildConfigurationList = 961FC51122E0265400C72877 /* Build configuration list for PBXNativeTarget "DocsCode" */; buildPhases = ( - 55257E5545A2F032E687BC09 /* [CP] Check Pods Manifest.lock */, 1179FA72263B0735004965CE /* Run SwiftLint */, 961FC4FA22E0265300C72877 /* Sources */, 961FC4FB22E0265300C72877 /* Frameworks */, 961FC4FC22E0265300C72877 /* Resources */, 8AAD08F22486DA4700664446 /* Apply Mapbox Access Token */, - F950CC2C42695542D911B66E /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -323,19 +299,21 @@ isa = PBXNativeTarget; buildConfigurationList = C58FB8681FE899B800C4B491 /* Build configuration list for PBXNativeTarget "Navigation-Examples" */; buildPhases = ( - 681991D14C08B65381FAF053 /* [CP] Check Pods Manifest.lock */, 1179FA71263ACDD3004965CE /* Run SwiftLint */, C58FB8521FE899B800C4B491 /* Sources */, C58FB8531FE899B800C4B491 /* Frameworks */, C58FB8541FE899B800C4B491 /* Resources */, C543192F1FFC41470066A20A /* Apply Mapbox Access Token */, - 891789705D70A1C1104FF552 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( ); name = "Navigation-Examples"; + packageProductDependencies = ( + FCE40784292CF2FD000CFEC3 /* MapboxCoreNavigation */, + FCE40786292CF2FD000CFEC3 /* MapboxNavigation */, + ); productName = "Navigation Examples"; productReference = C58FB8561FE899B800C4B491 /* Navigation-Examples.app */; productType = "com.apple.product-type.application"; @@ -371,6 +349,9 @@ Base, ); mainGroup = C58FB84D1FE899B800C4B491; + packageReferences = ( + FCE40783292CF2FD000CFEC3 /* XCRemoteSwiftPackageReference "mapbox-navigation-ios" */, + ); productRefGroup = C58FB8571FE899B800C4B491 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -444,90 +425,6 @@ shellPath = /bin/sh; shellScript = "if which swiftlint >/dev/null; then\n swiftlint --strict \nfi \n"; }; - 55257E5545A2F032E687BC09 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-DocsCode-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 681991D14C08B65381FAF053 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Navigation-Examples-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - 891789705D70A1C1104FF552 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Navigation-Examples/Pods-Navigation-Examples-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/MapboxCoreNavigation/MapboxCoreNavigation.framework", - "${BUILT_PRODUCTS_DIR}/MapboxDirections/MapboxDirections.framework", - "${BUILT_PRODUCTS_DIR}/MapboxMaps/MapboxMaps.framework", - "${BUILT_PRODUCTS_DIR}/MapboxNavigation/MapboxNavigation.framework", - "${BUILT_PRODUCTS_DIR}/MapboxSpeech/MapboxSpeech.framework", - "${BUILT_PRODUCTS_DIR}/Polyline/Polyline.framework", - "${BUILT_PRODUCTS_DIR}/Solar-dev/Solar.framework", - "${BUILT_PRODUCTS_DIR}/Turf/Turf.framework", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxCommon/MapboxCommon.framework/MapboxCommon", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxCoreMaps/MapboxCoreMaps.framework/MapboxCoreMaps", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxMobileEvents/MapboxMobileEvents.framework/MapboxMobileEvents", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxNavigationNative/MapboxNavigationNative.framework/MapboxNavigationNative", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxCoreNavigation.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxDirections.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxMaps.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxNavigation.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxSpeech.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Polyline.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Solar.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Turf.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxCommon.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxCoreMaps.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxMobileEvents.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxNavigationNative.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Navigation-Examples/Pods-Navigation-Examples-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; 8AAD08F22486DA4700664446 /* Apply Mapbox Access Token */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -562,46 +459,6 @@ shellPath = /bin/sh; shellScript = "$SRCROOT/Scripts/apply-mapbox-access-token.sh\n"; }; - F950CC2C42695542D911B66E /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/MapboxCoreNavigation/MapboxCoreNavigation.framework", - "${BUILT_PRODUCTS_DIR}/MapboxDirections/MapboxDirections.framework", - "${BUILT_PRODUCTS_DIR}/MapboxMaps/MapboxMaps.framework", - "${BUILT_PRODUCTS_DIR}/MapboxNavigation/MapboxNavigation.framework", - "${BUILT_PRODUCTS_DIR}/MapboxSpeech/MapboxSpeech.framework", - "${BUILT_PRODUCTS_DIR}/Polyline/Polyline.framework", - "${BUILT_PRODUCTS_DIR}/Solar-dev/Solar.framework", - "${BUILT_PRODUCTS_DIR}/Turf/Turf.framework", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxCommon/MapboxCommon.framework/MapboxCommon", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxCoreMaps/MapboxCoreMaps.framework/MapboxCoreMaps", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxMobileEvents/MapboxMobileEvents.framework/MapboxMobileEvents", - "${PODS_XCFRAMEWORKS_BUILD_DIR}/MapboxNavigationNative/MapboxNavigationNative.framework/MapboxNavigationNative", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxCoreNavigation.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxDirections.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxMaps.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxNavigation.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxSpeech.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Polyline.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Solar.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Turf.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxCommon.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxCoreMaps.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxMobileEvents.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/MapboxNavigationNative.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-DocsCode/Pods-DocsCode-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -677,14 +534,16 @@ /* Begin XCBuildConfiguration section */ 961FC51222E0265400C72877 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = A8D998B34DD96F479CF96712 /* Pods-DocsCode.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = GJZR2MEM28; INFOPLIST_FILE = DocsCode/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.nav.DocsCode; @@ -696,14 +555,16 @@ }; 961FC51322E0265400C72877 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 751C9DE4E717073D370EB4EF /* Pods-DocsCode.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = GJZR2MEM28; INFOPLIST_FILE = DocsCode/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.nav.DocsCode; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -820,20 +681,23 @@ IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; C58FB8691FE899B800C4B491 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E4F99A65CCB2B9CB623270EE /* Pods-Navigation-Examples.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = GJZR2MEM28; INFOPLIST_FILE = "Navigation-Examples/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.Mapbox.Navigation-Examples"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -843,13 +707,15 @@ }; C58FB86A1FE899B800C4B491 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 0544DEF056F7B94F491CBD53 /* Pods-Navigation-Examples.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = GJZR2MEM28; INFOPLIST_FILE = "Navigation-Examples/Info.plist"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); PRODUCT_BUNDLE_IDENTIFIER = "com.Mapbox.Navigation-Examples"; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -888,6 +754,30 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + FCE40783292CF2FD000CFEC3 /* XCRemoteSwiftPackageReference "mapbox-navigation-ios" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/mapbox/mapbox-navigation-ios.git"; + requirement = { + kind = exactVersion; + version = 2.9.0; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + FCE40784292CF2FD000CFEC3 /* MapboxCoreNavigation */ = { + isa = XCSwiftPackageProductDependency; + package = FCE40783292CF2FD000CFEC3 /* XCRemoteSwiftPackageReference "mapbox-navigation-ios" */; + productName = MapboxCoreNavigation; + }; + FCE40786292CF2FD000CFEC3 /* MapboxNavigation */ = { + isa = XCSwiftPackageProductDependency; + package = FCE40783292CF2FD000CFEC3 /* XCRemoteSwiftPackageReference "mapbox-navigation-ios" */; + productName = MapboxNavigation; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = C58FB84E1FE899B800C4B491 /* Project object */; } diff --git a/Navigation-Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Navigation-Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 4289a93a..919434a6 100644 --- a/Navigation-Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/Navigation-Examples.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/Navigation-Examples.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Navigation-Examples.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 00000000..18d98100 --- /dev/null +++ b/Navigation-Examples.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Navigation-Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Navigation-Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 00000000..7298d2fe --- /dev/null +++ b/Navigation-Examples.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,113 @@ +{ + "pins" : [ + { + "identity" : "mapbox-common-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-common-ios.git", + "state" : { + "revision" : "dbb2e33e29ba3bb75b9f63673504a5847c8c6e24", + "version" : "23.1.0" + } + }, + { + "identity" : "mapbox-core-maps-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-core-maps-ios.git", + "state" : { + "revision" : "b343d4fbb120b31c8a48cfbda0e87bb0c39da779", + "version" : "10.9.1" + } + }, + { + "identity" : "mapbox-directions-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-directions-swift.git", + "state" : { + "revision" : "2f91fad31087e6c66bd7cc65f31095babb038493", + "version" : "2.8.0" + } + }, + { + "identity" : "mapbox-events-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-events-ios.git", + "state" : { + "revision" : "91ae071c0232c144251dfe0d0724525deaf293d4", + "version" : "1.0.10" + } + }, + { + "identity" : "mapbox-maps-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-maps-ios.git", + "state" : { + "revision" : "ad4db5ce4b12ef6c353967f09b64543032b937bf", + "version" : "10.9.1" + } + }, + { + "identity" : "mapbox-navigation-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-navigation-ios.git", + "state" : { + "revision" : "63a7d36f241c71799521bd0a6e12838619b38207", + "version" : "2.9.0" + } + }, + { + "identity" : "mapbox-navigation-native-ios", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-navigation-native-ios.git", + "state" : { + "revision" : "b0789163a2a6454cccf3d64eb2bec291e5bf2fd8", + "version" : "119.0.3" + } + }, + { + "identity" : "mapbox-speech-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/mapbox-speech-swift.git", + "state" : { + "revision" : "285622fa9734d4b28c9eca10fa59a47699ca39fd", + "version" : "2.1.0" + } + }, + { + "identity" : "polyline", + "kind" : "remoteSourceControl", + "location" : "https://github.com/raphaelmor/Polyline.git", + "state" : { + "revision" : "353f80378dcd8f17eefe8550090c6b1ae3c9da23", + "version" : "5.1.0" + } + }, + { + "identity" : "solar", + "kind" : "remoteSourceControl", + "location" : "https://github.com/ceeK/Solar.git", + "state" : { + "revision" : "c2b96f2d5fb7f835b91cefac5e83101f54643901", + "version" : "3.0.1" + } + }, + { + "identity" : "swift-argument-parser", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-argument-parser", + "state" : { + "revision" : "fddd1c00396eed152c45a46bea9f47b98e59301d", + "version" : "1.2.0" + } + }, + { + "identity" : "turf-swift", + "kind" : "remoteSourceControl", + "location" : "https://github.com/mapbox/turf-swift.git", + "state" : { + "revision" : "87b5b37108ba9f37f0885b586d8f6355d8240dd8", + "version" : "2.6.1" + } + } + ], + "version" : 2 +} diff --git a/Navigation-Examples/ExampleContainerViewController.swift b/Navigation-Examples/ExampleContainerViewController.swift index f16a7fdb..6c22764b 100644 --- a/Navigation-Examples/ExampleContainerViewController.swift +++ b/Navigation-Examples/ExampleContainerViewController.swift @@ -15,6 +15,8 @@ class ExampleContainerViewController: UITableViewController { var hasEnteredExample = false var pushExampleToViewController = false + var currentViewController: UIViewController? + override func viewDidLoad() { super.viewDidLoad() self.navigationItem.title = exampleName @@ -29,8 +31,10 @@ class ExampleContainerViewController: UITableViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) if hasEnteredExample { - if let last = view.subviews.last { - last.removeFromSuperview() + if let last = currentViewController { + last.willMove(toParent: nil) + last.view.removeFromSuperview() + last.removeFromParent() hasEnteredExample = false } } @@ -48,6 +52,8 @@ class ExampleContainerViewController: UITableViewController { private func embed(controller: UIViewController, shouldPush: Bool) { addChild(controller) view.addSubview(controller.view) + + self.currentViewController = controller controller.didMove(toParent: self) if shouldPush { diff --git a/Navigation-Examples/Examples/Advanced.swift b/Navigation-Examples/Examples/Advanced.swift index 6113e826..adf882bd 100644 --- a/Navigation-Examples/Examples/Advanced.swift +++ b/Navigation-Examples/Examples/Advanced.swift @@ -119,12 +119,8 @@ class AdvancedViewController: UIViewController, NavigationMapViewDelegate, Navig credentials: NavigationSettings.shared.directions.credentials, simulating: simulationIsEnabled ? .always : .onPoorGPS) - let navigationOptions = NavigationOptions(navigationService: navigationService, - // Replace default `NavigationMapView` instance with instance that is used in preview mode. - navigationMapView: navigationMapView) - let navigationViewController = NavigationViewController(for: indexedRouteResponse, - navigationOptions: navigationOptions) + let navigationViewController = NavigationViewController(navigationService: navigationService) navigationViewController.delegate = self navigationViewController.modalPresentationStyle = .fullScreen @@ -186,10 +182,8 @@ class AdvancedViewController: UIViewController, NavigationMapViewDelegate, Navig self.routeResponse = response self.startButton?.isHidden = false - if let routes = self.routes, - let currentRoute = self.currentRoute { - self.navigationMapView.show(routes) - self.navigationMapView.showWaypoints(on: currentRoute) + if let routes = self.routes { + self.navigationMapView.showcase(routes) } } } @@ -220,9 +214,6 @@ class AdvancedViewController: UIViewController, NavigationMapViewDelegate, Navig // delegate should be re-assigned back to `NavigationMapView` that is used in preview mode. self.navigationMapView.delegate = self - // Replace `NavigationMapView` instance with instance that was used in active navigation. - self.navigationMapView = navigationViewController.navigationMapView - // Since `NavigationViewController` uses `UserPuckCourseView` as a default style // of the user location indicator - revert to back to default look in preview mode. self.navigationMapView.userLocationStyle = .puck2D() diff --git a/Navigation-Examples/Examples/Basic.swift b/Navigation-Examples/Examples/Basic.swift index 0101fc46..b734b08b 100644 --- a/Navigation-Examples/Examples/Basic.swift +++ b/Navigation-Examples/Examples/Basic.swift @@ -10,6 +10,7 @@ import UIKit import MapboxCoreNavigation import MapboxNavigation import MapboxDirections +import CoreLocation class BasicViewController: UIViewController { override func viewDidLoad() { diff --git a/Navigation-Examples/Examples/Custom-RoutingProvider.swift b/Navigation-Examples/Examples/Custom-RoutingProvider.swift index 3e823fe2..98869d86 100644 --- a/Navigation-Examples/Examples/Custom-RoutingProvider.swift +++ b/Navigation-Examples/Examples/Custom-RoutingProvider.swift @@ -10,6 +10,7 @@ import UIKit import MapboxCoreNavigation import MapboxNavigation import MapboxDirections +import CoreLocation /* This example demonstrates how users can control and customize the rerouting process. diff --git a/Navigation-Examples/Examples/Custom-Server.swift b/Navigation-Examples/Examples/Custom-Server.swift index c2908e05..6c5b61b8 100644 --- a/Navigation-Examples/Examples/Custom-Server.swift +++ b/Navigation-Examples/Examples/Custom-Server.swift @@ -30,7 +30,7 @@ class CustomServerViewController: UIViewController { case .failure(let error): print(error.localizedDescription) case .success(let response): - guard let strongSelf = self else { + guard let self = self else { return } @@ -41,12 +41,12 @@ class CustomServerViewController: UIViewController { credentials: NavigationSettings.shared.directions.credentials, simulating: simulationIsEnabled ? .always : .onPoorGPS) let navigationOptions = NavigationOptions(navigationService: navigationService) - strongSelf.navigationViewController = NavigationViewController(for: indexedRouteResponse, + let navigationViewController = NavigationViewController(for: indexedRouteResponse, navigationOptions: navigationOptions) - strongSelf.navigationViewController?.modalPresentationStyle = .fullScreen - strongSelf.navigationViewController?.delegate = strongSelf - - strongSelf.present(strongSelf.navigationViewController!, animated: true, completion: nil) + navigationViewController.modalPresentationStyle = .fullScreen + navigationViewController.delegate = self + self.navigationViewController = navigationViewController + self.present(navigationViewController, animated: true, completion: nil) } } } diff --git a/Navigation-Examples/Examples/Custom-Voice-Controller.swift b/Navigation-Examples/Examples/Custom-Voice-Controller.swift index 04da632b..8382507c 100644 --- a/Navigation-Examples/Examples/Custom-Voice-Controller.swift +++ b/Navigation-Examples/Examples/Custom-Voice-Controller.swift @@ -12,6 +12,7 @@ import MapboxNavigation import MapboxDirections import MapboxSpeech import AVFoundation +import CoreLocation class CustomVoiceControllerUI: UIViewController { diff --git a/Navigation-Examples/Examples/CustomBars/CustomBarsViewController.swift b/Navigation-Examples/Examples/CustomBars/CustomBarsViewController.swift index 8372476d..46ced0f8 100644 --- a/Navigation-Examples/Examples/CustomBars/CustomBarsViewController.swift +++ b/Navigation-Examples/Examples/CustomBars/CustomBarsViewController.swift @@ -10,6 +10,7 @@ import UIKit import MapboxCoreNavigation import MapboxNavigation import MapboxDirections +import CoreLocation class CustomBarsViewController: UIViewController { override func viewDidLoad() { diff --git a/Navigation-Examples/Examples/CustomSegue/CustomSegue.storyboard b/Navigation-Examples/Examples/CustomSegue/CustomSegue.storyboard index 7dd78124..93bbb7d5 100644 --- a/Navigation-Examples/Examples/CustomSegue/CustomSegue.storyboard +++ b/Navigation-Examples/Examples/CustomSegue/CustomSegue.storyboard @@ -1,9 +1,9 @@ - + - + @@ -12,7 +12,7 @@ - + diff --git a/Navigation-Examples/Examples/CustomSegue/Navigation-From-Segue.swift b/Navigation-Examples/Examples/CustomSegue/Navigation-From-Segue.swift index 778a8afa..ffd8e136 100644 --- a/Navigation-Examples/Examples/CustomSegue/Navigation-From-Segue.swift +++ b/Navigation-Examples/Examples/CustomSegue/Navigation-From-Segue.swift @@ -9,6 +9,7 @@ import UIKit import MapboxNavigation import MapboxCoreNavigation import MapboxDirections +import CoreLocation class SegueViewController: UIViewController { diff --git a/Navigation-Examples/Examples/Predictive-Caching.swift b/Navigation-Examples/Examples/Predictive-Caching.swift index 96b50d9d..00ce7e20 100644 --- a/Navigation-Examples/Examples/Predictive-Caching.swift +++ b/Navigation-Examples/Examples/Predictive-Caching.swift @@ -9,6 +9,7 @@ import UIKit import MapboxCoreNavigation import MapboxNavigation import MapboxDirections +import CoreLocation class PredictiveCachingViewController: UIViewController { override func viewDidLoad() { diff --git a/Navigation-Examples/Examples/Route-Alerts.swift b/Navigation-Examples/Examples/Route-Alerts.swift index f8643b8e..54d71501 100644 --- a/Navigation-Examples/Examples/Route-Alerts.swift +++ b/Navigation-Examples/Examples/Route-Alerts.swift @@ -79,7 +79,7 @@ class TopAlertsBarViewController: ContainerViewController { // To change top banner size and position change layout constraints directly. let topAlertsBannerViewConstraints: [NSLayoutConstraint] = [ - topAlertsBannerView.topAnchor.constraint(equalTo: view.topAnchor, constant: 10), + topAlertsBannerView.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 10), topAlertsBannerView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 60), topAlertsBannerView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: -60), topAlertsBannerView.heightAnchor.constraint(equalToConstant: 100.0), diff --git a/Navigation-Examples/Examples/Route-Deserialization.swift b/Navigation-Examples/Examples/Route-Deserialization.swift index 37f29255..e38f8419 100644 --- a/Navigation-Examples/Examples/Route-Deserialization.swift +++ b/Navigation-Examples/Examples/Route-Deserialization.swift @@ -9,6 +9,7 @@ import UIKit import MapboxCoreNavigation import MapboxNavigation import MapboxDirections +import CoreLocation class RouteDeserializationViewController: UIViewController { diff --git a/Navigation-Examples/Examples/Route-Initialization.swift b/Navigation-Examples/Examples/Route-Initialization.swift index 24406599..212d1ad2 100644 --- a/Navigation-Examples/Examples/Route-Initialization.swift +++ b/Navigation-Examples/Examples/Route-Initialization.swift @@ -10,6 +10,7 @@ import MapboxCoreNavigation import MapboxNavigation import MapboxDirections import Turf +import CoreLocation class RouteInitializationViewController: UIViewController { diff --git a/Navigation-Examples/Examples/Route-Lines-Styling.swift b/Navigation-Examples/Examples/Route-Lines-Styling.swift index d9cc3463..07dba783 100644 --- a/Navigation-Examples/Examples/Route-Lines-Styling.swift +++ b/Navigation-Examples/Examples/Route-Lines-Styling.swift @@ -53,6 +53,8 @@ class RouteLinesStylingViewController: UIViewController { navigationMapView.showWaypoints(on: currentRoute) } + var startButton: UIButton! + // MARK: - UIViewController lifecycle methods override func viewDidLoad() { @@ -68,23 +70,32 @@ class RouteLinesStylingViewController: UIViewController { func setupNavigationMapView() { navigationMapView = NavigationMapView(frame: view.bounds) navigationMapView.autoresizingMask = [.flexibleWidth, .flexibleHeight] - navigationMapView.delegate = self navigationMapView.userLocationStyle = .puck2D() + navigationMapView.delegate = self + let navigationViewportDataSource = NavigationViewportDataSource(navigationMapView.mapView, viewportDataSourceType: .raw) navigationMapView.navigationCamera.viewportDataSource = navigationViewportDataSource + changeMapStyle(navigationMapView) view.addSubview(navigationMapView) } func setupPerformActionBarButtonItem() { - let settingsBarButtonItem = UIBarButtonItem(title: NSString(string: "\u{2699}\u{0000FE0E}") as String, - style: .plain, - target: self, - action: #selector(performAction)) - settingsBarButtonItem.setTitleTextAttributes([.font: UIFont.systemFont(ofSize: 30)], for: .normal) - settingsBarButtonItem.setTitleTextAttributes([.font: UIFont.systemFont(ofSize: 30)], for: .highlighted) - navigationItem.rightBarButtonItem = settingsBarButtonItem + startButton = UIButton() + startButton.setTitle("Options", for: .normal) + startButton.translatesAutoresizingMaskIntoConstraints = false + startButton.backgroundColor = .blue + startButton.contentEdgeInsets = UIEdgeInsets(top: 10, left: 20, bottom: 10, right: 20) + startButton.layer.cornerRadius = 10 + startButton.clipsToBounds = true + startButton.addTarget(self, action: #selector(performAction(_:)), for: .touchUpInside) + startButton.isHidden = true + view.addSubview(startButton) + + startButton.bottomAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.bottomAnchor, constant: -20).isActive = true + startButton.centerXAnchor.constraint(equalTo: self.view.centerXAnchor).isActive = true + view.setNeedsLayout() } @objc func performAction(_ sender: Any) { @@ -131,7 +142,8 @@ class RouteLinesStylingViewController: UIViewController { let navigationOptions = NavigationOptions(navigationService: navigationService) let navigationViewController = NavigationViewController(for: indexedRouteResponse, navigationOptions: navigationOptions) - navigationViewController.delegate = self + navigationViewController.routeLineTracksTraversal = true + changeMapStyle(navigationViewController.navigationMapView) navigationViewController.modalPresentationStyle = .fullScreen navigationViewController.routeLineTracksTraversal = true @@ -171,103 +183,39 @@ class RouteLinesStylingViewController: UIViewController { if let currentRoute = self?.currentRoute { self?.navigationMapView.showWaypoints(on: currentRoute) } + self?.startButton.isHidden = false } } } -} - -// MARK: - NavigationMapViewDelegate methods - -extension RouteLinesStylingViewController: NavigationMapViewDelegate { - - func lineWidthExpression(_ multiplier: Double = 1.0) -> Expression { - let lineWidthExpression = Exp(.interpolate) { - Exp(.linear) - Exp(.zoom) - // It's possible to change route line width depending on zoom level, by using expression - // instead of constant. Navigation SDK for iOS also exposes `RouteLineWidthByZoomLevel` - // public property, which contains default values for route lines on specific zoom levels. - RouteLineWidthByZoomLevel.multiplied(by: multiplier) - } - - return lineWidthExpression - } - - func navigationMapView(_ mapView: NavigationMapView, didSelect route: Route) { - currentRouteIndex = routes?.firstIndex(of: route) ?? 0 - } - - // It's possible to change route line shape in preview mode by adding own implementation to either - // `NavigationMapView.navigationMapView(_:shapeFor:)` or `NavigationMapView.navigationMapView(_:casingShapeFor:)`. - func navigationMapView(_ navigationMapView: NavigationMapView, shapeFor route: Route) -> LineString? { - return route.shape - } - func navigationMapView(_ navigationMapView: NavigationMapView, casingShapeFor route: Route) -> LineString? { - return route.shape - } - - func navigationMapView(_ navigationMapView: NavigationMapView, routeLineLayerWithIdentifier identifier: String, sourceIdentifier: String) -> LineLayer? { - var lineLayer = LineLayer(id: identifier) - lineLayer.source = sourceIdentifier - - // `identifier` parameter contains unique identifier of the route layer or its casing. - // Such identifier consists of several parts: unique address of route object, whether route is - // main or alternative, and whether route is casing or not. For example: identifier for - // main route line will look like this: `0x0000600001168000.main.route_line`, and for - // alternative route line casing will look like this: `0x0000600001ddee80.alternative.route_line_casing`. - lineLayer.lineColor = .constant(.init(identifier.contains("main") ? #colorLiteral(red: 0.337254902, green: 0.6588235294, blue: 0.9843137255, alpha: 1) : #colorLiteral(red: 0.6, green: 0.6, blue: 0.6, alpha: 1))) - lineLayer.lineWidth = .expression(lineWidthExpression()) - lineLayer.lineJoin = .constant(.round) - lineLayer.lineCap = .constant(.round) - - return lineLayer - } - - func navigationMapView(_ navigationMapView: NavigationMapView, routeCasingLineLayerWithIdentifier identifier: String, sourceIdentifier: String) -> LineLayer? { - var lineLayer = LineLayer(id: identifier) - lineLayer.source = sourceIdentifier - - // Based on information stored in `identifier` property (whether route line is main or not) - // route line will be colored differently. - lineLayer.lineColor = .constant(.init(identifier.contains("main") ? #colorLiteral(red: 0.1843137255, green: 0.4784313725, blue: 0.7764705882, alpha: 1) : #colorLiteral(red: 0.4, green: 0.4, blue: 0.4, alpha: 1))) - lineLayer.lineWidth = .expression(lineWidthExpression(1.2)) - lineLayer.lineJoin = .constant(.round) - lineLayer.lineCap = .constant(.round) - - return lineLayer + func changeMapStyle(_ navigationMapView: NavigationMapView?) { + navigationMapView?.traversedRouteColor = .black + navigationMapView?.trafficUnknownColor = .red + navigationMapView?.trafficLowColor = .red + navigationMapView?.trafficUnknownColor = .yellow + navigationMapView?.trafficLowColor = .purple + navigationMapView?.trafficModerateColor = .green + navigationMapView?.trafficHeavyColor = .gray + navigationMapView?.trafficSevereColor = .orange + navigationMapView?.alternativeTrafficUnknownColor = .systemPink + navigationMapView?.alternativeTrafficLowColor = .brown + navigationMapView?.alternativeTrafficModerateColor = .cyan + navigationMapView?.alternativeTrafficHeavyColor = .magenta + navigationMapView?.alternativeTrafficSevereColor = .systemTeal + navigationMapView?.routeRestrictedAreaColor = .systemTeal + + navigationMapView?.routeCasingColor = .red + navigationMapView?.routeAlternateColor = .orange + navigationMapView?.routeAlternateCasingColor = .brown + navigationMapView?.traversedRouteColor = .darkGray + navigationMapView?.maneuverArrowColor = .blue + navigationMapView?.maneuverArrowStrokeColor = .systemPink } } -// MARK: - NavigationViewControllerDelegate methods - -extension RouteLinesStylingViewController: NavigationViewControllerDelegate { - - func navigationViewControllerDidDismiss(_ navigationViewController: NavigationViewController, byCanceling canceled: Bool) { - dismiss(animated: true, completion: nil) - } - - // Similarly to preview mode, when using `NavigationMapView`, it's possible to change - // route line styling during active guidance in `NavigationViewController`. - func navigationViewController(_ navigationViewController: NavigationViewController, routeLineLayerWithIdentifier identifier: String, sourceIdentifier: String) -> LineLayer? { - var lineLayer = LineLayer(id: identifier) - lineLayer.source = sourceIdentifier - lineLayer.lineColor = .constant(.init(identifier.contains("main") ? #colorLiteral(red: 0.337254902, green: 0.6588235294, blue: 0.9843137255, alpha: 1) : #colorLiteral(red: 0.6, green: 0.6, blue: 0.6, alpha: 1))) - lineLayer.lineWidth = .expression(lineWidthExpression()) - lineLayer.lineJoin = .constant(.round) - lineLayer.lineCap = .constant(.round) - - return lineLayer - } - - func navigationViewController(_ navigationViewController: NavigationViewController, routeCasingLineLayerWithIdentifier identifier: String, sourceIdentifier: String) -> LineLayer? { - var lineLayer = LineLayer(id: identifier) - lineLayer.source = sourceIdentifier - lineLayer.lineColor = .constant(.init(identifier.contains("main") ? #colorLiteral(red: 0.1843137255, green: 0.4784313725, blue: 0.7764705882, alpha: 1) : #colorLiteral(red: 0.4, green: 0.4, blue: 0.4, alpha: 1))) - lineLayer.lineWidth = .expression(lineWidthExpression(1.2)) - lineLayer.lineJoin = .constant(.round) - lineLayer.lineCap = .constant(.round) - - return lineLayer +extension RouteLinesStylingViewController: NavigationMapViewDelegate { + // Delegate method called when the user selects a route + func navigationMapView(_ mapView: NavigationMapView, didSelect route: Route) { + self.currentRouteIndex = self.routes?.firstIndex(of: route) ?? 0 } } diff --git a/Navigation-Examples/Examples/Styled-UI-Elements.swift b/Navigation-Examples/Examples/Styled-UI-Elements.swift index a2d31e95..9aee8914 100644 --- a/Navigation-Examples/Examples/Styled-UI-Elements.swift +++ b/Navigation-Examples/Examples/Styled-UI-Elements.swift @@ -10,6 +10,7 @@ import UIKit import MapboxCoreNavigation import MapboxNavigation import MapboxDirections +import CoreLocation class CustomStyleUIElements: UIViewController { override func viewDidLoad() { diff --git a/Navigation-Examples/Examples/Waypoint-Arrival-Screen.swift b/Navigation-Examples/Examples/Waypoint-Arrival-Screen.swift index 2297056f..43a4885b 100644 --- a/Navigation-Examples/Examples/Waypoint-Arrival-Screen.swift +++ b/Navigation-Examples/Examples/Waypoint-Arrival-Screen.swift @@ -18,8 +18,8 @@ class WaypointArrivalScreenViewController: UIViewController { super.viewDidLoad() let waypointOne = Waypoint(coordinate: CLLocationCoordinate2DMake(37.777655950348475, -122.43199467658997)) - let waypointTwo = Waypoint(coordinate: CLLocationCoordinate2DMake(37.776087132342745, -122.4329173564911)) - let waypointThree = Waypoint(coordinate: CLLocationCoordinate2DMake(37.775357832637184, -122.43493974208832)) + let waypointTwo = Waypoint(coordinate: CLLocationCoordinate2DMake(37.778545, -122.433373)) + let waypointThree = Waypoint(coordinate: CLLocationCoordinate2DMake(37.779509, -122.432100)) let routeOptions = NavigationRouteOptions(waypoints: [waypointOne, waypointTwo, waypointThree]) diff --git a/Podfile b/Podfile deleted file mode 100644 index e348064e..00000000 --- a/Podfile +++ /dev/null @@ -1,13 +0,0 @@ -install! 'cocoapods', :warn_for_unused_master_specs_repo => false - -platform :ios, '12.0' -use_frameworks! - -pod 'MapboxCoreNavigation', '~> 2.9.0' -pod 'MapboxNavigation', '~> 2.9.0' - -target 'Navigation-Examples' do -end - -target 'DocsCode' do -end diff --git a/Podfile.lock b/Podfile.lock deleted file mode 100644 index 58bbb58c..00000000 --- a/Podfile.lock +++ /dev/null @@ -1,66 +0,0 @@ -PODS: - - MapboxCommon (23.1.0) - - MapboxCoreMaps (10.9.1): - - MapboxCommon (~> 23.1) - - MapboxCoreNavigation (2.9.0): - - MapboxDirections (~> 2.8) - - MapboxMobileEvents (~> 1.0) - - MapboxNavigationNative (~> 119.0) - - MapboxDirections (2.8.0): - - Polyline (~> 5.0) - - Turf (~> 2.6.1) - - MapboxMaps (10.9.1): - - MapboxCommon (= 23.1.0) - - MapboxCoreMaps (= 10.9.1) - - MapboxMobileEvents (= 1.0.8) - - Turf (~> 2.0) - - MapboxMobileEvents (1.0.8) - - MapboxNavigation (2.9.0): - - MapboxCoreNavigation (= 2.9.0) - - MapboxMaps (~> 10.9) - - MapboxMobileEvents (~> 1.0) - - MapboxSpeech (~> 2.0) - - Solar-dev (~> 3.0) - - MapboxNavigationNative (119.0.2): - - MapboxCommon (~> 23.1) - - MapboxSpeech (2.1.0) - - Polyline (5.1.0) - - Solar-dev (3.0.1) - - Turf (2.6.1) - -DEPENDENCIES: - - MapboxCoreNavigation (~> 2.9.0) - - MapboxNavigation (~> 2.9.0) - -SPEC REPOS: - trunk: - - MapboxCommon - - MapboxCoreMaps - - MapboxCoreNavigation - - MapboxDirections - - MapboxMaps - - MapboxMobileEvents - - MapboxNavigation - - MapboxNavigationNative - - MapboxSpeech - - Polyline - - Solar-dev - - Turf - -SPEC CHECKSUMS: - MapboxCommon: bfffb68226f650df065cf24e307576267ebc75e8 - MapboxCoreMaps: c74e3dd1d7d2b8c0ca5503d8c3e8ef79a8feccd5 - MapboxCoreNavigation: 82285c8e3d77349bed7e5eae29edc53acd84dbbd - MapboxDirections: fa70b4970f974dd39463657d3c2d5cbd0c504b7b - MapboxMaps: f5e3858e71a923f0e2fc168a93397cfd98341dc5 - MapboxMobileEvents: febdd92835daa258ca1c1faad0821c0b3394ef40 - MapboxNavigation: 34d4b6d7dd311ee595aeae9970dc7f47a118f993 - MapboxNavigationNative: 37581c8ce1287e19ad95d8059d73c4a3f054bf65 - MapboxSpeech: a3789121e8d91eb9bc9af6ddd60768729a918f71 - Polyline: 2a1f29f87f8d9b7de868940f4f76deb8c678a5b1 - Solar-dev: 4612dc9878b9fed2667d23b327f1d4e54e16e8d0 - Turf: 469ce2c3d22e5e8e4818d5a3b254699a5c89efa4 - -PODFILE CHECKSUM: 0d91fb064ed479e26f74e2d68b0d0491803c485a - -COCOAPODS: 1.11.3 diff --git a/readme.md b/readme.md index a678b176..0f626251 100644 --- a/readme.md +++ b/readme.md @@ -10,8 +10,7 @@ A collection of examples showing off the [Mapbox Navigation SDK](https://github. _Installation with CocoaPods_ -1. `git clone https://github.com/mapbox/mapbox-navigation-ios-examples.git` -1. `cd mapbox-navigation-ios-examples` +1. Open project and wait for couple of minutes. SPM need to load mapbox Navigation SDK dependencies. ☕️ 1. Go to your [Mapbox account dashboard](https://account.mapbox.com/) and create an access token that has the `DOWNLOADS:READ` scope. **PLEASE NOTE: This is not the same as your production Mapbox API token. Make sure to keep it private and do not insert it into any Info.plist file.** Create a file named `.netrc` in your home directory if it doesn’t already exist, then add the following lines to the end of the file: ``` machine api.mapbox.com @@ -19,7 +18,6 @@ _Installation with CocoaPods_ password YOUR_SECRET_MAPBOX_TOKEN ``` where _YOUR_SECRET_MAPBOX_TOKEN_ is your Mapbox API token with the `DOWNLOADS:READ` scope. The login should always be `mapbox`. It should not be your personal username used to create the secret token. -1. Run `pod repo update && pod install` and open the resulting Navigation-Examples.xcworkspace. 1. Sign up or log in to your Mapbox account and grab a [Mapbox access token](https://www.mapbox.com/help/define-access-token/). 1. Enter your Mapbox access token into the value of the `MBXAccessToken` key within the Info.plist file. Alternatively, if you plan to use this project as the basis for any open source application, [read this guide](https://docs.mapbox.com/help/troubleshooting/private-access-token-android-and-ios/#ios) to learn how to best protect your access tokens. 1. Building and run the Navigation-Examples scheme.