diff --git a/README.md b/README.md index d3d2d57c..aa505c4c 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ For an overview of the existing features, please check the _Developer Guide_ for > For now, the _Navigate Edition_ is only available upon request. Please contact your HERE representative to receive access including a set of evaluation credentials. -## List of Available Example Apps (Version 4.19.3.0) +## List of Available Example Apps (Version 4.19.4.0) - **HelloMap**: Shows the classic 'Hello World'. - **HelloMapKotlin**: Shows the classic 'Hello World' using Kotlin language (Android only). diff --git a/examples/latest/README.md b/examples/latest/README.md index 46fed70f..232c5120 100644 --- a/examples/latest/README.md +++ b/examples/latest/README.md @@ -1,4 +1,4 @@ -This folder contains the HERE SDK examples apps for version: 4.19.3.0 +This folder contains the HERE SDK examples apps for version: 4.19.4.0 - HERE SDK for Android ([Lite Edition](lite/android/), [Explore Edition](explore/android/), [Navigate Edition](navigate/android/)) - HERE SDK for iOS ([Lite Edition](lite/ios/), [Explore Edition](explore/ios/), [Navigate Edition](navigate/ios/)) diff --git a/examples/latest/explore/ios/Camera/Camera.xcodeproj/project.pbxproj b/examples/latest/explore/ios/Camera/Camera.xcodeproj/project.pbxproj index 6d523322..f658290d 100644 --- a/examples/latest/explore/ios/Camera/Camera.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/Camera/Camera.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ - C827C5432329371C003AA0C5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C827C5422329371C003AA0C5 /* AppDelegate.swift */; }; - C827C5452329371C003AA0C5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C827C5442329371C003AA0C5 /* ViewController.swift */; }; - C827C5482329371C003AA0C5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C827C5462329371C003AA0C5 /* Main.storyboard */; }; - C827C54A23293725003AA0C5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C827C54923293725003AA0C5 /* Assets.xcassets */; }; - C827C54D23293726003AA0C5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */; }; - C827C555232938B2003AA0C5 /* CameraExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C827C554232938B2003AA0C5 /* CameraExample.swift */; }; - C88C019223CDFDD600043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C019123CDFDD500043918 /* heresdk.xcframework */; }; - C88C019323CDFDD600043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C019123CDFDD500043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 83C837BC2C207F340004F54E /* CameraApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* CameraApp.swift */; }; + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BD2C207F340004F54E /* ContentView.swift */; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* CameraExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* CameraExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C827C559232938DA003AA0C5 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C019323CDFDD600043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,64 +31,68 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C827C53F2329371C003AA0C5 /* Camera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Camera.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C827C5422329371C003AA0C5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C827C5442329371C003AA0C5 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C827C5472329371C003AA0C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C827C54923293725003AA0C5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C827C54C23293726003AA0C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C827C54E23293726003AA0C5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C827C554232938B2003AA0C5 /* CameraExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraExample.swift; sourceTree = ""; }; - C88C019123CDFDD500043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Camera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Camera.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* CameraApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraApp.swift; sourceTree = ""; }; + 83C837BD2C207F340004F54E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 83C837BF2C207F360004F54E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 83C837C22C207F360004F54E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837D02C20EFA70004F54E /* CameraExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C827C53C2329371C003AA0C5 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C019223CDFDD600043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C827C5362329371C003AA0C5 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C827C5412329371C003AA0C5 /* Camera */, - C827C5402329371C003AA0C5 /* Products */, - C88C019023CDFDD400043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* Camera */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C827C5402329371C003AA0C5 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C827C53F2329371C003AA0C5 /* Camera.app */, + 83C837B82C207F340004F54E /* Camera.app */, ); name = Products; sourceTree = ""; }; - C827C5412329371C003AA0C5 /* Camera */ = { + 83C837BA2C207F340004F54E /* Camera */ = { isa = PBXGroup; children = ( - C827C5422329371C003AA0C5 /* AppDelegate.swift */, - C827C5442329371C003AA0C5 /* ViewController.swift */, - C827C554232938B2003AA0C5 /* CameraExample.swift */, - C827C5462329371C003AA0C5 /* Main.storyboard */, - C827C54923293725003AA0C5 /* Assets.xcassets */, - C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */, - C827C54E23293726003AA0C5 /* Info.plist */, + 83C837BB2C207F340004F54E /* CameraApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* CameraExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = Camera; sourceTree = ""; }; - C88C019023CDFDD400043918 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C88C019123CDFDD500043918 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -97,14 +100,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C827C53E2329371C003AA0C5 /* Camera */ = { + 83C837B72C207F340004F54E /* Camera */ = { isa = PBXNativeTarget; - buildConfigurationList = C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "Camera" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Camera" */; buildPhases = ( - C827C53B2329371C003AA0C5 /* Sources */, - C827C53C2329371C003AA0C5 /* Frameworks */, - C827C53D2329371C003AA0C5 /* Resources */, - C827C559232938DA003AA0C5 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -112,97 +115,76 @@ ); name = Camera; productName = Camera; - productReference = C827C53F2329371C003AA0C5 /* Camera.app */; + productReference = 83C837B82C207F340004F54E /* Camera.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C827C5372329371C003AA0C5 /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1030; - LastUpgradeCheck = 1250; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C827C53E2329371C003AA0C5 = { - CreatedOnToolsVersion = 10.3; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C827C53A2329371C003AA0C5 /* Build configuration list for PBXProject "Camera" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Camera" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C827C5362329371C003AA0C5; - productRefGroup = C827C5402329371C003AA0C5 /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C827C53E2329371C003AA0C5 /* Camera */, + 83C837B72C207F340004F54E /* Camera */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C827C53D2329371C003AA0C5 /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C827C54D23293726003AA0C5 /* LaunchScreen.storyboard in Resources */, - C827C54A23293725003AA0C5 /* Assets.xcassets in Resources */, - C827C5482329371C003AA0C5 /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C827C53B2329371C003AA0C5 /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C827C555232938B2003AA0C5 /* CameraExample.swift in Sources */, - C827C5452329371C003AA0C5 /* ViewController.swift in Sources */, - C827C5432329371C003AA0C5 /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* CameraApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* CameraExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C827C5462329371C003AA0C5 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C827C5472329371C003AA0C5 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C827C54C23293726003AA0C5 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C827C54F23293726003AA0C5 /* Debug */ = { + 83C837C42C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -228,12 +210,12 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -247,24 +229,25 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - C827C55023293726003AA0C5 /* Release */ = { + 83C837C52C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -290,12 +273,12 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -303,59 +286,71 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; - C827C55223293726003AA0C5 /* Debug */ = { + 83C837C72C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Camera/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Camera/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - C827C55323293726003AA0C5 /* Release */ = { + 83C837C82C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Camera/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Camera/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -364,25 +359,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C827C53A2329371C003AA0C5 /* Build configuration list for PBXProject "Camera" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Camera" */ = { isa = XCConfigurationList; buildConfigurations = ( - C827C54F23293726003AA0C5 /* Debug */, - C827C55023293726003AA0C5 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "Camera" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Camera" */ = { isa = XCConfigurationList; buildConfigurations = ( - C827C55223293726003AA0C5 /* Debug */, - C827C55323293726003AA0C5 /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C827C5372329371C003AA0C5 /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,98 +1,13 @@ { "images" : [ { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/Contents.json b/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/Contents.json +++ b/examples/latest/explore/ios/Camera/Camera/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/explore/ios/Camera/Camera/Base.lproj/LaunchScreen.storyboard b/examples/latest/explore/ios/Camera/Camera/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/explore/ios/Camera/Camera/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Camera/Camera/Base.lproj/Main.storyboard b/examples/latest/explore/ios/Camera/Camera/Base.lproj/Main.storyboard deleted file mode 100644 index 37a4f1b8..00000000 --- a/examples/latest/explore/ios/Camera/Camera/Base.lproj/Main.storyboard +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Camera/Camera/AppDelegate.swift b/examples/latest/explore/ios/Camera/Camera/CameraApp.swift similarity index 63% rename from examples/latest/explore/ios/Camera/Camera/AppDelegate.swift rename to examples/latest/explore/ios/Camera/Camera/CameraApp.swift index 5c8c8eef..a110a442 100644 --- a/examples/latest/explore/ios/Camera/Camera/AppDelegate.swift +++ b/examples/latest/explore/ios/Camera/Camera/CameraApp.swift @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 HERE Europe B.V. + * Copyright (C) 2022-2024 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,20 +18,34 @@ */ import heresdk -import UIKit +import SwiftUI -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. +// This class is the entry point to an application. +// HERE SDK initialization is done at start of app. When app is terminated, the HERE SDK is disposed. +@main +struct CameraApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } + + init() { + observeAppLifecycle() + // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. initializeHERESDK() - - return true + } + + private func observeAppLifecycle() { + NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, + object: nil, + queue: nil) { _ in + // Perform cleanup or final tasks here. + print("App is about to terminate.") + disposeHERESDK() + } } private func initializeHERESDK() { @@ -45,15 +59,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") } } - + private func disposeHERESDK() { // Free HERE SDK resources before the application shuts down. // Usually, this should be called only on application termination. - // Afterwards, the HERE SDK is no longer usable unless it is initialized again. + + // After this call, the HERE SDK is no longer usable unless it is initialized again. SDKNativeEngine.sharedInstance = nil } - - func applicationWillTerminate(_ application: UIApplication) { - disposeHERESDK() - } } diff --git a/examples/latest/explore/ios/Camera/Camera/CameraExample.swift b/examples/latest/explore/ios/Camera/Camera/CameraExample.swift index a161deec..16be4379 100644 --- a/examples/latest/explore/ios/Camera/Camera/CameraExample.swift +++ b/examples/latest/explore/ios/Camera/Camera/CameraExample.swift @@ -26,16 +26,15 @@ import UIKit class CameraExample: TapDelegate, MapCameraDelegate { private let defaultDistanceToEarthInMeters: Double = 8000 - private let viewController: UIViewController private let mapView: MapView private let camera: MapCamera private var cameraTargetView: UIImageView private var poiMapCircle: MapPolygon! - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView + // Configure the map. camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: defaultDistanceToEarthInMeters) camera.lookAt(point: GeoCoordinates(latitude: 52.750731,longitude: 13.007375), @@ -56,9 +55,19 @@ class CameraExample: TapDelegate, MapCameraDelegate { mapView.gestures.tapDelegate = self mapView.camera.addDelegate(self) + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) + showDialog(title: "Note", message: "Tap the map to set a new transform center.") } + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } + func onRotateButtonClicked() { rotateMap(bearingStepInDegrees: 10) } @@ -164,8 +173,19 @@ class CameraExample: TapDelegate, MapCameraDelegate { } private func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - viewController.present(alertController, animated: true, completion: nil) + if let topController = UIApplication.shared.windows.first?.rootViewController { + let alert = UIAlertController( + title: title, + message: message, + preferredStyle: .alert + ) + + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in + // Handle OK button action. + alert.dismiss(animated: true, completion: nil) + })) + + topController.present(alert, animated: true, completion: nil) + } } } diff --git a/examples/latest/explore/ios/Camera/Camera/ContentView.swift b/examples/latest/explore/ios/Camera/Camera/ContentView.swift new file mode 100644 index 00000000..73dfa2a1 --- /dev/null +++ b/examples/latest/explore/ios/Camera/Camera/ContentView.swift @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +struct ContentView: View { + + @State private var mapView = MapView() + @State private var cameraExample: CameraExample? + + var body: some View { + // Show the views on top of each other. + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + + HStack { + CustomButton(title: "Rotate") { + cameraExample?.onRotateButtonClicked() + } + CustomButton(title: "Tilt") { + cameraExample?.onTiltButtonClicked() + } + CustomButton(title: "Move") { + cameraExample?.onMoveToXYButtonClicked() + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + cameraExample = CameraExample(mapView) + } + } +} + +// The MapView provided by the HERE SDK conforms to a UIKit view, so it needs to be wrapped to conform +// to a SwiftUI view. The map view is created in the ContentView and bound here. +private struct WrappedMapView: UIViewRepresentable { + @Binding var mapView: MapView + func makeUIView(context: Context) -> MapView { return mapView } + func updateUIView(_ mapView: MapView, context: Context) { } +} + +// A reusable button to keep the layout clean. +struct CustomButton: View { + let title: String + let action: () -> Void + + var body: some View { + Button(action: action) { + Text(title) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/examples/latest/explore/ios/Camera/Camera/Info.plist b/examples/latest/explore/ios/Camera/Camera/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/explore/ios/Camera/Camera/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/latest/explore/ios/Camera/Camera/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/explore/ios/Camera/Camera/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/explore/ios/Camera/Camera/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/Camera/Camera/ViewController.swift b/examples/latest/explore/ios/Camera/Camera/ViewController.swift deleted file mode 100644 index d051ba91..00000000 --- a/examples/latest/explore/ios/Camera/Camera/ViewController.swift +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -final class ViewController: UIViewController { - - @IBOutlet private var mapView: MapView! - private var cameraExample: CameraExample! - private var isMapSceneLoaded = false - - override func viewDidLoad() { - super.viewDidLoad() - - // Load the map scene using a map style to render the map with. - mapView.mapScene.loadScene(mapScheme: .normalDay, completion: onLoadScene) - } - - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - // Start the example. - cameraExample = CameraExample(viewController: self, mapView: mapView) - isMapSceneLoaded = true - } - - @IBAction func onRotateButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraExample.onRotateButtonClicked() - } - } - - @IBAction func onTiltButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraExample.onTiltButtonClicked() - } - } - - @IBAction func onMoveToXYButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraExample.onMoveToXYButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/explore/ios/Camera/README.md b/examples/latest/explore/ios/Camera/README.md index 180976ae..f5c981cd 100644 --- a/examples/latest/explore/ios/Camera/README.md +++ b/examples/latest/explore/ios/Camera/README.md @@ -1,4 +1,4 @@ -The Canera example app shows how to change the target anchor point and how to move to another location using animations. You can find how this is done in [CameraExample.swift](Camera/CameraExample.swift). +The Camera example app shows how to change the target anchor point and how to move to another location using animations. You can find how this is done in [CameraExample.swift](Camera/CameraExample.swift). Build instructions: ------------------- diff --git a/examples/latest/explore/ios/EVRouting/EVRouting/RoutingExample.swift b/examples/latest/explore/ios/EVRouting/EVRouting/RoutingExample.swift index eb13c059..ef67a4db 100644 --- a/examples/latest/explore/ios/EVRouting/EVRouting/RoutingExample.swift +++ b/examples/latest/explore/ios/EVRouting/EVRouting/RoutingExample.swift @@ -280,7 +280,7 @@ class RoutingExample { let isolineOptions = IsolineOptions(calculationOptions: calculationOptions, evCarOptions: getEVCarOptions()) - routingEngine.calculateIsoline(center: Waypoint(coordinates: startGeoCoordinates), + isolineRoutingEngine.calculateIsoline(center: Waypoint(coordinates: startGeoCoordinates), isolineOptions: isolineOptions) { (routingError, isolines) in if let error = routingError { diff --git a/examples/latest/explore/ios/Routing/Routing.xcodeproj/project.pbxproj b/examples/latest/explore/ios/Routing/Routing.xcodeproj/project.pbxproj index 90a60ca8..20291f4d 100644 --- a/examples/latest/explore/ios/Routing/Routing.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/Routing/Routing.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ - C85F809221E5EDD800237ED0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85F809121E5EDD800237ED0 /* AppDelegate.swift */; }; - C85F809421E5EDD800237ED0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85F809321E5EDD800237ED0 /* ViewController.swift */; }; - C85F809721E5EDD800237ED0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C85F809521E5EDD800237ED0 /* Main.storyboard */; }; - C85F809921E5EDD900237ED0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C85F809821E5EDD900237ED0 /* Assets.xcassets */; }; - C85F809C21E5EDD900237ED0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C85F809A21E5EDD900237ED0 /* LaunchScreen.storyboard */; }; - C85F80A421E5FC8000237ED0 /* RoutingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85F80A321E5FC7F00237ED0 /* RoutingExample.swift */; }; - C88C015823CDF9FC00043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C015723CDF9FC00043918 /* heresdk.xcframework */; }; - C88C015923CDF9FC00043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C015723CDF9FC00043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 83C837BC2C207F340004F54E /* RoutingApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* RoutingApp.swift */; }; + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BD2C207F340004F54E /* ContentView.swift */; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* RoutingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* RoutingExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C88C015A23CDF9FC00043918 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C015923CDF9FC00043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,64 +31,68 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C85F808E21E5EDD800237ED0 /* Routing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Routing.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C85F809121E5EDD800237ED0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C85F809321E5EDD800237ED0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C85F809621E5EDD800237ED0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C85F809821E5EDD900237ED0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C85F809B21E5EDD900237ED0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C85F809D21E5EDD900237ED0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C85F80A321E5FC7F00237ED0 /* RoutingExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoutingExample.swift; sourceTree = ""; }; - C88C015723CDF9FC00043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Routing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Routing.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* RoutingApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoutingApp.swift; sourceTree = ""; }; + 83C837BD2C207F340004F54E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 83C837BF2C207F360004F54E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 83C837C22C207F360004F54E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837D02C20EFA70004F54E /* RoutingExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoutingExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C85F808B21E5EDD800237ED0 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C015823CDF9FC00043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C85F808521E5EDD700237ED0 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C85F809021E5EDD800237ED0 /* Routing */, - C85F808F21E5EDD800237ED0 /* Products */, - C88C015623CDF9FC00043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* Routing */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C85F808F21E5EDD800237ED0 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C85F808E21E5EDD800237ED0 /* Routing.app */, + 83C837B82C207F340004F54E /* Routing.app */, ); name = Products; sourceTree = ""; }; - C85F809021E5EDD800237ED0 /* Routing */ = { + 83C837BA2C207F340004F54E /* Routing */ = { isa = PBXGroup; children = ( - C85F809121E5EDD800237ED0 /* AppDelegate.swift */, - C85F809321E5EDD800237ED0 /* ViewController.swift */, - C85F80A321E5FC7F00237ED0 /* RoutingExample.swift */, - C85F809521E5EDD800237ED0 /* Main.storyboard */, - C85F809821E5EDD900237ED0 /* Assets.xcassets */, - C85F809A21E5EDD900237ED0 /* LaunchScreen.storyboard */, - C85F809D21E5EDD900237ED0 /* Info.plist */, + 83C837BB2C207F340004F54E /* RoutingApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* RoutingExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = Routing; sourceTree = ""; }; - C88C015623CDF9FC00043918 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C88C015723CDF9FC00043918 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -97,14 +100,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C85F808D21E5EDD800237ED0 /* Routing */ = { + 83C837B72C207F340004F54E /* Routing */ = { isa = PBXNativeTarget; - buildConfigurationList = C85F80A021E5EDD900237ED0 /* Build configuration list for PBXNativeTarget "Routing" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Routing" */; buildPhases = ( - C85F808A21E5EDD800237ED0 /* Sources */, - C85F808B21E5EDD800237ED0 /* Frameworks */, - C85F808C21E5EDD800237ED0 /* Resources */, - C88C015A23CDF9FC00043918 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -112,98 +115,76 @@ ); name = Routing; productName = Routing; - productReference = C85F808E21E5EDD800237ED0 /* Routing.app */; + productReference = 83C837B82C207F340004F54E /* Routing.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C85F808621E5EDD700237ED0 /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1010; - LastUpgradeCheck = 1250; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C85F808D21E5EDD800237ED0 = { - CreatedOnToolsVersion = 10.1; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C85F808921E5EDD700237ED0 /* Build configuration list for PBXProject "Routing" */; - compatibilityVersion = "Xcode 3.2"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Routing" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C85F808521E5EDD700237ED0; - productRefGroup = C85F808F21E5EDD800237ED0 /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C85F808D21E5EDD800237ED0 /* Routing */, + 83C837B72C207F340004F54E /* Routing */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C85F808C21E5EDD800237ED0 /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C85F809C21E5EDD900237ED0 /* LaunchScreen.storyboard in Resources */, - C85F809921E5EDD900237ED0 /* Assets.xcassets in Resources */, - C85F809721E5EDD800237ED0 /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C85F808A21E5EDD800237ED0 /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C85F809421E5EDD800237ED0 /* ViewController.swift in Sources */, - C85F809221E5EDD800237ED0 /* AppDelegate.swift in Sources */, - C85F80A421E5FC8000237ED0 /* RoutingExample.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* RoutingApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* RoutingExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C85F809521E5EDD800237ED0 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C85F809621E5EDD800237ED0 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C85F809A21E5EDD900237ED0 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C85F809B21E5EDD900237ED0 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C85F809E21E5EDD900237ED0 /* Debug */ = { + 83C837C42C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -229,12 +210,12 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -248,24 +229,25 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - C85F809F21E5EDD900237ED0 /* Release */ = { + 83C837C52C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -291,12 +273,12 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -304,59 +286,71 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; - C85F80A121E5EDD900237ED0 /* Debug */ = { + 83C837C72C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Routing/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Routing/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - C85F80A221E5EDD900237ED0 /* Release */ = { + 83C837C82C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Routing/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Routing/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -365,25 +359,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C85F808921E5EDD700237ED0 /* Build configuration list for PBXProject "Routing" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Routing" */ = { isa = XCConfigurationList; buildConfigurations = ( - C85F809E21E5EDD900237ED0 /* Debug */, - C85F809F21E5EDD900237ED0 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C85F80A021E5EDD900237ED0 /* Build configuration list for PBXNativeTarget "Routing" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Routing" */ = { isa = XCConfigurationList; buildConfigurations = ( - C85F80A121E5EDD900237ED0 /* Debug */, - C85F80A221E5EDD900237ED0 /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C85F808621E5EDD700237ED0 /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,98 +1,13 @@ { "images" : [ { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/Contents.json b/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/Contents.json +++ b/examples/latest/explore/ios/Routing/Routing/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/explore/ios/Routing/Routing/Base.lproj/LaunchScreen.storyboard b/examples/latest/explore/ios/Routing/Routing/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/explore/ios/Routing/Routing/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Routing/Routing/Base.lproj/Main.storyboard b/examples/latest/explore/ios/Routing/Routing/Base.lproj/Main.storyboard deleted file mode 100644 index fa2f536a..00000000 --- a/examples/latest/explore/ios/Routing/Routing/Base.lproj/Main.storyboard +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Routing/Routing/ContentView.swift b/examples/latest/explore/ios/Routing/Routing/ContentView.swift new file mode 100644 index 00000000..57c2a9db --- /dev/null +++ b/examples/latest/explore/ios/Routing/Routing/ContentView.swift @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +struct ContentView: View { + + @State private var mapView = MapView() + @State private var routingExample: RoutingExample? + + var body: some View { + // Show the views on top of each other. + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + + VStack { + HStack { + CustomButton(title: "Add route") { + routingExample?.addRoute() + } + CustomButton(title: "Add waypoints") { + routingExample?.addWaypoints() + } + CustomButton(title: "Clear map") { + routingExample?.clearMap() + } + } + HStack { + CustomToggleButton(onLabel: "Traffic optimization: On", offLabel: "Traffic optimization: Off") { + routingExample?.toggleTrafficOptimization() + } + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + routingExample = RoutingExample(mapView) + } + } +} + +// The MapView provided by the HERE SDK conforms to a UIKit view, so it needs to be wrapped to conform +// to a SwiftUI view. The map view is created in the ContentView and bound here. +private struct WrappedMapView: UIViewRepresentable { + @Binding var mapView: MapView + func makeUIView(context: Context) -> MapView { return mapView } + func updateUIView(_ mapView: MapView, context: Context) { } +} + +// A reusable button to keep the layout clean. +struct CustomButton: View { + let title: String + let action: () -> Void + + var body: some View { + Button(action: action) { + Text(title) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +// A reusable toggle button to keep the layout clean. +struct CustomToggleButton: View { + @State private var isOn: Bool = false + var onLabel: String + var offLabel: String + var action: () -> Void + + var body: some View { + Button(action: { + isOn.toggle() + action() + }) { + Text(isOn ? onLabel : offLabel) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/examples/latest/explore/ios/Routing/Routing/Info.plist b/examples/latest/explore/ios/Routing/Routing/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/explore/ios/Routing/Routing/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/latest/explore/ios/Routing/Routing/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/explore/ios/Routing/Routing/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/explore/ios/Routing/Routing/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/Routing/Routing/RoutingApp.swift b/examples/latest/explore/ios/Routing/Routing/RoutingApp.swift new file mode 100644 index 00000000..30ab2420 --- /dev/null +++ b/examples/latest/explore/ios/Routing/Routing/RoutingApp.swift @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +// This class is the entry point to an application. +// HERE SDK initialization is done at start of app. When app is terminated, the HERE SDK is disposed. +@main +struct RoutingApp: App { + + var body: some Scene { + WindowGroup { + ContentView() + } + } + + init() { + observeAppLifecycle() + + // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. + initializeHERESDK() + } + + private func observeAppLifecycle() { + NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, + object: nil, + queue: nil) { _ in + // Perform cleanup or final tasks here. + print("App is about to terminate.") + disposeHERESDK() + } + } + + private func initializeHERESDK() { + // Set your credentials for the HERE SDK. + let accessKeyID = "YOUR_ACCESS_KEY_ID" + let accessKeySecret = "YOUR_ACCESS_KEY_SECRET" + let options = SDKOptions(accessKeyId: accessKeyID, accessKeySecret: accessKeySecret) + do { + try SDKNativeEngine.makeSharedInstance(options: options) + } catch let engineInstantiationError { + fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") + } + } + + private func disposeHERESDK() { + // Free HERE SDK resources before the application shuts down. + // Usually, this should be called only on application termination. + + // After this call, the HERE SDK is no longer usable unless it is initialized again. + SDKNativeEngine.sharedInstance = nil + } +} diff --git a/examples/latest/explore/ios/Routing/Routing/RoutingExample.swift b/examples/latest/explore/ios/Routing/Routing/RoutingExample.swift index ca7ace4d..8b281726 100644 --- a/examples/latest/explore/ios/Routing/Routing/RoutingExample.swift +++ b/examples/latest/explore/ios/Routing/Routing/RoutingExample.swift @@ -22,7 +22,6 @@ import UIKit class RoutingExample { - private var viewController: UIViewController private var mapView: MapView private var mapMarkers = [MapMarker]() private var mapPolylineList = [MapPolyline]() @@ -31,18 +30,31 @@ class RoutingExample { private var destinationGeoCoordinates: GeoCoordinates? private var disableOptimization = false - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView + + do { + try routingEngine = RoutingEngine() + } catch let engineInstantiationError { + fatalError("Failed to initialize routing engine. Cause: \(engineInstantiationError)") + } + + // Configure the map. let camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) camera.lookAt(point: GeoCoordinates(latitude: 52.520798, longitude: 13.409408), zoom: distanceInMeters) - do { - try routingEngine = RoutingEngine() - } catch let engineInstantiationError { - fatalError("Failed to initialize routing engine. Cause: \(engineInstantiationError)") + mapView.mapScene.enableFeatures([MapFeatures.lowSpeedZones : MapFeatureModes.lowSpeedZonesAll]); + + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) + } + + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") } } @@ -390,8 +402,19 @@ class RoutingExample { } private func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - viewController.present(alertController, animated: true, completion: nil) + if let topController = UIApplication.shared.windows.first?.rootViewController { + let alert = UIAlertController( + title: title, + message: message, + preferredStyle: .alert + ) + + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in + // Handle OK button action. + alert.dismiss(animated: true, completion: nil) + })) + + topController.present(alert, animated: true, completion: nil) + } } } diff --git a/examples/latest/explore/ios/Routing/Routing/ViewController.swift b/examples/latest/explore/ios/Routing/Routing/ViewController.swift deleted file mode 100644 index 023ebd69..00000000 --- a/examples/latest/explore/ios/Routing/Routing/ViewController.swift +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -final class ViewController: UIViewController { - - @IBOutlet private var mapView: MapView! - @IBOutlet weak var button: UIButton! - private var disableTrafficOptimization = false - private var routingExample: RoutingExample! - private var isMapSceneLoaded = false - - override func viewDidLoad() { - super.viewDidLoad() - mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) - } - - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - mapView.mapScene.enableFeatures([MapFeatures.lowSpeedZones : MapFeatureModes.lowSpeedZonesAll]); - - // Start the example. - self.routingExample = RoutingExample(viewController: self, mapView: self.mapView!) - self.isMapSceneLoaded = true - } - - @IBAction func onAddRouteButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - routingExample.addRoute() - } - } - - @IBAction func onAddWaypointsButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - routingExample.addWaypoints() - } - } - - @IBAction func onClearMapButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - routingExample.clearMap() - } - } - - @IBAction func toggleTraffic(_ sender: UIButton) { - if disableTrafficOptimization { - sender.setTitle("Traffic Optimization-On", for: .normal) - } else { - sender.setTitle("Traffic Optimization-Off", for: .normal) - } - disableTrafficOptimization = !disableTrafficOptimization - routingExample.toggleTrafficOptimization() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/explore/ios/Search/Search.xcodeproj/project.pbxproj b/examples/latest/explore/ios/Search/Search.xcodeproj/project.pbxproj index 3a24ebb3..17f4e508 100644 --- a/examples/latest/explore/ios/Search/Search.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/Search/Search.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ - C88C018223CDFD2000043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018123CDFD2000043918 /* heresdk.xcframework */; }; - C88C018323CDFD2000043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018123CDFD2000043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - C8D0BAE62163D074002FD93D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BAE52163D074002FD93D /* AppDelegate.swift */; }; - C8D0BAE82163D074002FD93D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BAE72163D074002FD93D /* ViewController.swift */; }; - C8D0BAEB2163D074002FD93D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BAE92163D074002FD93D /* Main.storyboard */; }; - C8D0BAED2163D076002FD93D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BAEC2163D076002FD93D /* Assets.xcassets */; }; - C8D0BAF02163D076002FD93D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BAEE2163D076002FD93D /* LaunchScreen.storyboard */; }; - C8D0BAF82163D2F6002FD93D /* SearchExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BAF72163D2F6002FD93D /* SearchExample.swift */; }; + 83C837BC2C207F340004F54E /* SearchApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* SearchApp.swift */; }; + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BD2C207F340004F54E /* ContentView.swift */; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* SearchExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* SearchExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C8288831224BD40B004903B8 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C018323CDFD2000043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,79 +31,83 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C88C018123CDFD2000043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; - C8D0BAE22163D074002FD93D /* Search.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Search.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C8D0BAE52163D074002FD93D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C8D0BAE72163D074002FD93D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C8D0BAEA2163D074002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C8D0BAEC2163D076002FD93D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C8D0BAEF2163D076002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C8D0BAF12163D076002FD93D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C8D0BAF72163D2F6002FD93D /* SearchExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchExample.swift; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Search.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Search.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* SearchApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchApp.swift; sourceTree = ""; }; + 83C837BD2C207F340004F54E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 83C837BF2C207F360004F54E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 83C837C22C207F360004F54E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837D02C20EFA70004F54E /* SearchExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C8D0BADF2163D074002FD93D /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C018223CDFD2000043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C88C018023CDFD2000043918 /* Frameworks */ = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C88C018123CDFD2000043918 /* heresdk.xcframework */, + 83C837BA2C207F340004F54E /* Search */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); - name = Frameworks; sourceTree = ""; }; - C8D0BAD92163D074002FD93D = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C8D0BAE42163D074002FD93D /* Search */, - C8D0BAE32163D074002FD93D /* Products */, - C88C018023CDFD2000043918 /* Frameworks */, + 83C837B82C207F340004F54E /* Search.app */, ); + name = Products; sourceTree = ""; }; - C8D0BAE32163D074002FD93D /* Products */ = { + 83C837BA2C207F340004F54E /* Search */ = { isa = PBXGroup; children = ( - C8D0BAE22163D074002FD93D /* Search.app */, + 83C837BB2C207F340004F54E /* SearchApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* SearchExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); - name = Products; + path = Search; sourceTree = ""; }; - C8D0BAE42163D074002FD93D /* Search */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C8D0BAE52163D074002FD93D /* AppDelegate.swift */, - C8D0BAE72163D074002FD93D /* ViewController.swift */, - C8D0BAF72163D2F6002FD93D /* SearchExample.swift */, - C8D0BAE92163D074002FD93D /* Main.storyboard */, - C8D0BAEC2163D076002FD93D /* Assets.xcassets */, - C8D0BAEE2163D076002FD93D /* LaunchScreen.storyboard */, - C8D0BAF12163D076002FD93D /* Info.plist */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, ); - path = Search; + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, + ); + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C8D0BAE12163D074002FD93D /* Search */ = { + 83C837B72C207F340004F54E /* Search */ = { isa = PBXNativeTarget; - buildConfigurationList = C8D0BAF42163D076002FD93D /* Build configuration list for PBXNativeTarget "Search" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Search" */; buildPhases = ( - C8D0BADE2163D074002FD93D /* Sources */, - C8D0BADF2163D074002FD93D /* Frameworks */, - C8D0BAE02163D074002FD93D /* Resources */, - C8288831224BD40B004903B8 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -112,98 +115,76 @@ ); name = Search; productName = Search; - productReference = C8D0BAE22163D074002FD93D /* Search.app */; + productReference = 83C837B82C207F340004F54E /* Search.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C8D0BADA2163D074002FD93D /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1000; - LastUpgradeCheck = 1000; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C8D0BAE12163D074002FD93D = { - CreatedOnToolsVersion = 10.0; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C8D0BADD2163D074002FD93D /* Build configuration list for PBXProject "Search" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Search" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C8D0BAD92163D074002FD93D; - productRefGroup = C8D0BAE32163D074002FD93D /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C8D0BAE12163D074002FD93D /* Search */, + 83C837B72C207F340004F54E /* Search */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C8D0BAE02163D074002FD93D /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BAF02163D076002FD93D /* LaunchScreen.storyboard in Resources */, - C8D0BAED2163D076002FD93D /* Assets.xcassets in Resources */, - C8D0BAEB2163D074002FD93D /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C8D0BADE2163D074002FD93D /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BAE82163D074002FD93D /* ViewController.swift in Sources */, - C8D0BAF82163D2F6002FD93D /* SearchExample.swift in Sources */, - C8D0BAE62163D074002FD93D /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* SearchApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* SearchExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C8D0BAE92163D074002FD93D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BAEA2163D074002FD93D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C8D0BAEE2163D076002FD93D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BAEF2163D076002FD93D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C8D0BAF22163D076002FD93D /* Debug */ = { + 83C837C42C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -222,18 +203,19 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -247,24 +229,25 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - C8D0BAF32163D076002FD93D /* Release */ = { + 83C837C52C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -283,18 +266,19 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -302,59 +286,71 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; - C8D0BAF52163D076002FD93D /* Debug */ = { + 83C837C72C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Search/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Search/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - C8D0BAF62163D076002FD93D /* Release */ = { + 83C837C82C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Search/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Search/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -363,25 +359,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C8D0BADD2163D074002FD93D /* Build configuration list for PBXProject "Search" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Search" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BAF22163D076002FD93D /* Debug */, - C8D0BAF32163D076002FD93D /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C8D0BAF42163D076002FD93D /* Build configuration list for PBXNativeTarget "Search" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Search" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BAF52163D076002FD93D /* Debug */, - C8D0BAF62163D076002FD93D /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C8D0BADA2163D074002FD93D /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/explore/ios/Search/Search/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/explore/ios/Search/Search/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/explore/ios/Search/Search/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/Search/Search/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/explore/ios/Search/Search/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/explore/ios/Search/Search/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/explore/ios/Search/Search/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,98 +1,13 @@ { "images" : [ { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/explore/ios/Search/Search/Assets.xcassets/Contents.json b/examples/latest/explore/ios/Search/Search/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/explore/ios/Search/Search/Assets.xcassets/Contents.json +++ b/examples/latest/explore/ios/Search/Search/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/explore/ios/Search/Search/Base.lproj/LaunchScreen.storyboard b/examples/latest/explore/ios/Search/Search/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/explore/ios/Search/Search/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Search/Search/Base.lproj/Main.storyboard b/examples/latest/explore/ios/Search/Search/Base.lproj/Main.storyboard deleted file mode 100644 index d729e6e9..00000000 --- a/examples/latest/explore/ios/Search/Search/Base.lproj/Main.storyboard +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Search/Search/ContentView.swift b/examples/latest/explore/ios/Search/Search/ContentView.swift new file mode 100644 index 00000000..c61f2b63 --- /dev/null +++ b/examples/latest/explore/ios/Search/Search/ContentView.swift @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +struct ContentView: View { + + @State private var mapView = MapView() + @State private var searchExample: SearchExample? + + var body: some View { + // Show the views on top of each other. + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + + HStack { + CustomButton(title: "Search example") { + searchExample?.onSearchButtonClicked() + } + CustomButton(title: "GeoCode example") { + searchExample?.onGeoCodeButtonClicked() + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + searchExample = SearchExample(mapView) + } + } +} + +// The MapView provided by the HERE SDK conforms to a UIKit view, so it needs to be wrapped to conform +// to a SwiftUI view. The map view is created in the ContentView and bound here. +private struct WrappedMapView: UIViewRepresentable { + @Binding var mapView: MapView + func makeUIView(context: Context) -> MapView { return mapView } + func updateUIView(_ mapView: MapView, context: Context) { } +} + +// A reusable button to keep the layout clean. +struct CustomButton: View { + let title: String + let action: () -> Void + + var body: some View { + Button(action: action) { + Text(title) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/examples/latest/explore/ios/Search/Search/Info.plist b/examples/latest/explore/ios/Search/Search/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/explore/ios/Search/Search/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/latest/explore/ios/Search/Search/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/explore/ios/Search/Search/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/explore/ios/Search/Search/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/Camera/Camera/AppDelegate.swift b/examples/latest/explore/ios/Search/Search/SearchApp.swift similarity index 63% rename from examples/latest/navigate/ios/Camera/Camera/AppDelegate.swift rename to examples/latest/explore/ios/Search/Search/SearchApp.swift index 5c8c8eef..89117573 100644 --- a/examples/latest/navigate/ios/Camera/Camera/AppDelegate.swift +++ b/examples/latest/explore/ios/Search/Search/SearchApp.swift @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 HERE Europe B.V. + * Copyright (C) 2022-2024 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,20 +18,34 @@ */ import heresdk -import UIKit +import SwiftUI -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. +// This class is the entry point to an application. +// HERE SDK initialization is done at start of app. When app is terminated, the HERE SDK is disposed. +@main +struct SearchApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } + + init() { + observeAppLifecycle() + // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. initializeHERESDK() - - return true + } + + private func observeAppLifecycle() { + NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, + object: nil, + queue: nil) { _ in + // Perform cleanup or final tasks here. + print("App is about to terminate.") + disposeHERESDK() + } } private func initializeHERESDK() { @@ -45,15 +59,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") } } - + private func disposeHERESDK() { // Free HERE SDK resources before the application shuts down. // Usually, this should be called only on application termination. - // Afterwards, the HERE SDK is no longer usable unless it is initialized again. + + // After this call, the HERE SDK is no longer usable unless it is initialized again. SDKNativeEngine.sharedInstance = nil } - - func applicationWillTerminate(_ application: UIApplication) { - disposeHERESDK() - } } diff --git a/examples/latest/explore/ios/Search/Search/SearchExample.swift b/examples/latest/explore/ios/Search/Search/SearchExample.swift index 654d569a..4731b792 100644 --- a/examples/latest/explore/ios/Search/Search/SearchExample.swift +++ b/examples/latest/explore/ios/Search/Search/SearchExample.swift @@ -23,14 +23,14 @@ import UIKit class SearchExample: TapDelegate, LongPressDelegate { - private var viewController: UIViewController private var mapView: MapView private var mapMarkers = [MapMarker]() private var searchEngine: SearchEngine - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView + + // Configure the map. let camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) camera.lookAt(point: GeoCoordinates(latitude: 52.520798, longitude: 13.409408), @@ -45,9 +45,19 @@ class SearchExample: TapDelegate, mapView.gestures.tapDelegate = self mapView.gestures.longPressDelegate = self + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) + showDialog(title: "Note", message: "Long press on map to get the address for that position using reverse geocoding.") } + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } + func onSearchButtonClicked() { // Search for "Pizza" and show the results on the map. searchExample() @@ -313,13 +323,7 @@ class SearchExample: TapDelegate, // Note: This algorithm assumes an unrotated map view. return GeoBox(southWestCorner: southWestCorner, northEastCorner: northEastCorner) } - - private func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - viewController.present(alertController, animated: true, completion: nil) - } - + private func clearMap() { for mapMarker in mapMarkers { mapView.mapScene.removeMapMarker(mapMarker) @@ -327,4 +331,21 @@ class SearchExample: TapDelegate, mapMarkers.removeAll() } + + private func showDialog(title: String, message: String) { + if let topController = UIApplication.shared.windows.first?.rootViewController { + let alert = UIAlertController( + title: title, + message: message, + preferredStyle: .alert + ) + + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in + // Handle OK button action. + alert.dismiss(animated: true, completion: nil) + })) + + topController.present(alert, animated: true, completion: nil) + } + } } diff --git a/examples/latest/explore/ios/Search/Search/ViewController.swift b/examples/latest/explore/ios/Search/Search/ViewController.swift deleted file mode 100644 index b10f0a9c..00000000 --- a/examples/latest/explore/ios/Search/Search/ViewController.swift +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -final class ViewController: UIViewController { - - @IBOutlet private var mapView: MapView! - private var searchExample: SearchExample! - private var isMapSceneLoaded = false - - override func viewDidLoad() { - super.viewDidLoad() - - // Load the map scene using a map style to render the map with. - mapView.mapScene.loadScene(mapScheme: .normalDay, completion: onLoadScene) - } - - func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - // Start the example. - searchExample = SearchExample(viewController: self, mapView: mapView!) - isMapSceneLoaded = true - } - - @IBAction func onSearchButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - searchExample.onSearchButtonClicked() - } - } - - @IBAction func onGeoCodeButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - searchExample.onGeoCodeButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/android/HikingDiary/app/src/main/java/com/here/hikingdiary/MainActivity.java b/examples/latest/navigate/android/HikingDiary/app/src/main/java/com/here/hikingdiary/MainActivity.java index f65962aa..40f2587a 100644 --- a/examples/latest/navigate/android/HikingDiary/app/src/main/java/com/here/hikingdiary/MainActivity.java +++ b/examples/latest/navigate/android/HikingDiary/app/src/main/java/com/here/hikingdiary/MainActivity.java @@ -50,11 +50,16 @@ import com.here.sdk.core.engine.SDKOptions; import com.here.sdk.core.errors.InstantiationErrorException; import com.here.sdk.mapview.MapError; +import com.here.sdk.mapview.MapFeatureModes; +import com.here.sdk.mapview.MapFeatures; import com.here.sdk.mapview.MapMeasure; import com.here.sdk.mapview.MapScene; import com.here.sdk.mapview.MapScheme; import com.here.sdk.mapview.MapView; import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class MainActivity extends AppCompatActivity { @@ -89,8 +94,10 @@ protected void onCreate(Bundle savedInstanceState) { public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (hikingApp != null) { if (isChecked) { + disableMapFeatures(); hikingApp.enableOutdoorRasterLayer(); } else { + enableMapFeatures(); hikingApp.disableOutdoorRasterLayer(); } } @@ -223,6 +230,7 @@ public void permissionsDenied() { @Override public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { + super.onRequestPermissionsResult(requestCode, permissions, grantResults); permissionsRequestor.onRequestPermissionsResult(requestCode, permissions, grantResults); } @@ -256,7 +264,7 @@ public void onClick(DialogInterface dialog, int id) { private void loadMapScene() { // Load a scene from the HERE SDK to render the map with a map scheme. - mapView.getMapScene().loadScene(MapScheme.SATELLITE, new MapScene.LoadSceneCallback() { + mapView.getMapScene().loadScene(MapScheme.TOPO_DAY, new MapScene.LoadSceneCallback() { @Override public void onLoadScene(@Nullable MapError mapError) { if (mapError == null) { @@ -265,6 +273,7 @@ public void onLoadScene(@Nullable MapError mapError) { mapView.getCamera().lookAt(new GeoCoordinates(52.530932, 13.384915), mapMeasureZoom); hikingApp = new HikingApp(mapView, MainActivity.this); hikingApp.hereBackgroundPositioningServiceProvider.startForegroundService(); + enableMapFeatures(); } else { Log.d(TAG, "Loading map failed: mapError: " + mapError.name()); } @@ -272,6 +281,29 @@ public void onLoadScene(@Nullable MapError mapError) { }); } + // Enhance the scene with map features suitable for hiking trips. + private void enableMapFeatures() { + Map mapFeatures = new HashMap<>(); + mapFeatures.put(MapFeatures.TERRAIN, MapFeatureModes.TERRAIN_3D); + mapFeatures.put(MapFeatures.CONTOURS, MapFeatureModes.CONTOURS_ALL); + mapFeatures.put(MapFeatures.BUILDING_FOOTPRINTS, MapFeatureModes.BUILDING_FOOTPRINTS_ALL); + mapFeatures.put(MapFeatures.EXTRUDED_BUILDINGS, MapFeatureModes.EXTRUDED_BUILDINGS_ALL); + mapFeatures.put(MapFeatures.LANDMARKS, MapFeatureModes.LANDMARKS_TEXTURED); + mapView.getMapScene().enableFeatures(mapFeatures); + } + + // When a custom raster outdoor layer is shown, we do not need to load + // hidden map features to save bandwidth. + private void disableMapFeatures() { + List mapFeatures = new ArrayList<>(); + mapFeatures.add(MapFeatures.TERRAIN); + mapFeatures.add(MapFeatures.CONTOURS); + mapFeatures.add(MapFeatures.BUILDING_FOOTPRINTS); + mapFeatures.add(MapFeatures.EXTRUDED_BUILDINGS); + mapFeatures.add(MapFeatures.LANDMARKS); + mapView.getMapScene().disableFeatures(mapFeatures); + } + private void showDialog(String title, String message) { new AlertDialog.Builder(this) .setTitle(title) diff --git a/examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/MainActivity.java b/examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/MainActivity.java index e5c8af5e..ba4f87bb 100644 --- a/examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/MainActivity.java +++ b/examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/MainActivity.java @@ -205,6 +205,7 @@ public void onClick(View view) { venueEngine.getVenueMap().getSelectedVenue().setTopologyVisible(true); } else { venueEngine.getVenueMap().getSelectedVenue().setTopologyVisible(false); + venueTapController.deselectTopolgy(); } } }); diff --git a/examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/VenueTapController.java b/examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/VenueTapController.java index 7c13324d..b8e2538c 100644 --- a/examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/VenueTapController.java +++ b/examples/latest/navigate/android/IndoorMap/app/src/main/java/com/here/sdk/examples/venues/VenueTapController.java @@ -346,7 +346,7 @@ private void deselectGeometry() { recyclerView.setAdapter(new SpaceAdapter(context, geometryList, (MainActivity) context)); } - private void deselectTopolgy() { + public void deselectTopolgy() { topologyLayout.setVisibility(View.GONE); sheetBehavior.setPeekHeight(300); // If there is a selected geometry, reset its style. diff --git a/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/LayerConfigurationExample.java b/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/LayerConfigurationExample.java new file mode 100644 index 00000000..93d302e2 --- /dev/null +++ b/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/LayerConfigurationExample.java @@ -0,0 +1,53 @@ +package com.here.offlinemaps; + +import android.util.Log; + +import com.here.sdk.core.engine.LayerConfiguration; + +import java.util.ArrayList; + +public class LayerConfigurationExample { + ArrayList features = new ArrayList<>(); + String TAG = LayerConfigurationExample.class.getSimpleName(); + + public LayerConfigurationExample() { + prepareFeatures(); + } + + public LayerConfiguration getCustomLayerConfiguration() { + LayerConfiguration layerConfiguration = new LayerConfiguration(); + layerConfiguration.enabledFeatures = features; + return layerConfiguration; + } + + private void prepareFeatures() { + // These features are enabled by default. + // We specify these features as part of the layer configuration to ensure that they are included in the feature list and enabled. + // For example, if the feature list contains navigation and TRUCK, then it enables only navigation and truck features and disables all others. + features.add(LayerConfiguration.Feature.NAVIGATION); + features.add(LayerConfiguration.Feature.DETAIL_RENDERING); + features.add(LayerConfiguration.Feature.RENDERING); + features.add(LayerConfiguration.Feature.TRUCK); + features.add(LayerConfiguration.Feature.OFFLINE_SEARCH); + features.add(LayerConfiguration.Feature.OFFLINE_ROUTING); + + // Enabling additional features. + features.add(LayerConfiguration.Feature.LANDMARKS_3D); + features.add(LayerConfiguration.Feature.TRAFFIC); + } + + public void addFeature(LayerConfiguration.Feature feature) { + features.add(feature); + } + + public void disableFeature(LayerConfiguration.Feature feature) { + features.remove(feature); + } + + public void printCurrentFeatures() { + Log.i(TAG, " Enabled Feature "); + for (LayerConfiguration.Feature feature : features) { + Log.i(TAG, " " + feature.name()); + } + } +} diff --git a/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/MainActivity.java b/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/MainActivity.java index 9cab82ec..d3613fe9 100644 --- a/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/MainActivity.java +++ b/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/MainActivity.java @@ -21,9 +21,11 @@ import android.content.Context; import android.os.Bundle; + import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.appcompat.app.AppCompatActivity; + import android.util.Log; import android.view.View; @@ -41,11 +43,14 @@ public class MainActivity extends AppCompatActivity { private PermissionsRequestor permissionsRequestor; private MapView mapView; private OfflineMapsExample offlineMapsExample; + private LayerConfigurationExample layerConfigurationExample; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); + layerConfigurationExample = new LayerConfigurationExample(); + // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. initializeHERESDK(); @@ -63,6 +68,15 @@ private void initializeHERESDK() { String accessKeyID = "YOUR_ACCESS_KEY_ID"; String accessKeySecret = "YOUR_ACCESS_KEY_SECRET"; SDKOptions options = new SDKOptions(accessKeyID, accessKeySecret); + + // Uncomment this to add a feature - + // layerConfigurationExample.addFeature(LayerConfiguration.Feature.TERRAIN); + // Uncomment this to disable a feature - + // layerConfigurationExample.disableFeature(LayerConfiguration.Feature.TRAFFIC); + // LayerConfiguration can only be updated before HERE SDK initialization. + options.layerConfiguration = layerConfigurationExample.getCustomLayerConfiguration(); + layerConfigurationExample.printCurrentFeatures(); + try { Context context = this; SDKNativeEngine.makeSharedInstance(context, options); @@ -73,7 +87,7 @@ private void initializeHERESDK() { private void handleAndroidPermissions() { permissionsRequestor = new PermissionsRequestor(this); - permissionsRequestor.request(new PermissionsRequestor.ResultListener(){ + permissionsRequestor.request(new PermissionsRequestor.ResultListener() { @Override public void permissionsGranted() { @@ -130,7 +144,7 @@ protected void onSaveInstanceState(@NonNull Bundle outState) { mapView.onSaveInstanceState(outState); super.onSaveInstanceState(outState); } - + private void disposeHERESDK() { // Free HERE SDK resources before the application shuts down. // Usually, this should be called only on application termination. diff --git a/examples/latest/navigate/android/SearchHybrid/app/src/main/java/com/here/search/SearchExample.java b/examples/latest/navigate/android/SearchHybrid/app/src/main/java/com/here/search/SearchExample.java index 02a23f51..c0a9f0fa 100644 --- a/examples/latest/navigate/android/SearchHybrid/app/src/main/java/com/here/search/SearchExample.java +++ b/examples/latest/navigate/android/SearchHybrid/app/src/main/java/com/here/search/SearchExample.java @@ -254,6 +254,9 @@ public void onSearchCompleted(@Nullable SearchError searchError, @Nullable List< // search results may not be available for all zoom levels. // Please also note that it may take time until the required map data is loaded. // Subsequently, the cache is filled when a user pans and zooms the map. + // + // For best results, it is recommended to permanently install offline region data and use the + // OfflineSearchEngine for areas where region data has been installed. showDialog("Search", "Error: " + searchError.toString()); return; } diff --git a/examples/latest/navigate/android/TruckGuidance/app/src/main/java/com/here/truckguidance/TruckGuidanceExample.java b/examples/latest/navigate/android/TruckGuidance/app/src/main/java/com/here/truckguidance/TruckGuidanceExample.java index ae23e946..c79523dd 100644 --- a/examples/latest/navigate/android/TruckGuidance/app/src/main/java/com/here/truckguidance/TruckGuidanceExample.java +++ b/examples/latest/navigate/android/TruckGuidance/app/src/main/java/com/here/truckguidance/TruckGuidanceExample.java @@ -872,7 +872,11 @@ private void searchAlongARoute(Route route) { searchOptions.languageCode = LanguageCode.EN_US; searchOptions.maxItems = 30; - // Note that TruckAmenities require this custom setting. + // Note: TruckAmenities require a custom option when searching online. + // This is not necessary when using the OfflineSearchEngine. + // Additionally, this feature is released as closed-alpha, meaning a license must + // be obtained from the HERE SDK team for online searches. + // Otherwise, a SearchError.FORBIDDEN will occur. searchEngine.setCustomOption("show", "truck"); searchEngine.search(categoryQuery, searchOptions, new SearchCallback() { @@ -892,6 +896,8 @@ public void onSearchCompleted(SearchError searchError, List items) { }); } + // Note: This is a closed-alpha feature that requires an additional license. + // Refer to the comment in searchAlongARoute() for more details. private void logPlaceAmenities(Place place) { TruckAmenities truckAmenities = place.getDetails().truckAmenities; if (truckAmenities != null) { diff --git a/examples/latest/navigate/flutter/hiking_diary_app/lib/main.dart b/examples/latest/navigate/flutter/hiking_diary_app/lib/main.dart index 5b32ac36..bf132e29 100644 --- a/examples/latest/navigate/flutter/hiking_diary_app/lib/main.dart +++ b/examples/latest/navigate/flutter/hiking_diary_app/lib/main.dart @@ -39,7 +39,8 @@ void main() { runApp( MaterialApp( // Enable localizations for the ConsentEngine's dialog widget. - localizationsDelegates: HereSdkConsentLocalizations.localizationsDelegates, + localizationsDelegates: + HereSdkConsentLocalizations.localizationsDelegates, supportedLocales: HereSdkConsentLocalizations.supportedLocales, home: MyApp(messageNotifier: MessageNotifier()), ), @@ -52,8 +53,10 @@ void _initializeHERESDK() async { // Set your credentials for the HERE SDK. String accessKeyId = "YOUR_ACCESS_KEY_ID"; - String accessKeySecret = "YOUR_ACCESS_KEY_SECRET"; - SDKOptions sdkOptions = SDKOptions.withAccessKeySecret(accessKeyId, accessKeySecret); + String accessKeySecret = + "YOUR_ACCESS_KEY_SECRET"; + SDKOptions sdkOptions = + SDKOptions.withAccessKeySecret(accessKeyId, accessKeySecret); try { await SDKNativeEngine.makeSharedInstance(sdkOptions); @@ -64,6 +67,7 @@ void _initializeHERESDK() async { class MyApp extends StatefulWidget { final MessageNotifier messageNotifier; + MyApp({required this.messageNotifier}); @override @@ -82,6 +86,8 @@ class _MyAppState extends State with WidgetsBindingObserver { ConsentEngine? _consentEngine; String _consentState = "Pending ..."; + HereMapController? _hereMapController; + @override void initState() { super.initState(); @@ -125,7 +131,8 @@ class _MyAppState extends State with WidgetsBindingObserver { IconButton( icon: Icon(Icons.menu), onPressed: () { - if (hikingApp != null && hikingApp!.gpxManager.gpxDocument.tracks.isNotEmpty) { + if (hikingApp != null && + hikingApp!.gpxManager.gpxDocument.tracks.isNotEmpty) { Navigator.push( context, MaterialPageRoute( @@ -157,10 +164,15 @@ class _MyAppState extends State with WidgetsBindingObserver { onChanged: (bool value) { setState(() { _mapLayerSwitch = value; - if (hikingApp != null && _isLocationPermissionGranted) { - value == true ? hikingApp!.enableOutdoorRasterLayer() : hikingApp!.disableOutdoorRasterLayer(); - } + if (_mapLayerSwitch) { + _enableMapFeatures(); + hikingApp!.enableOutdoorRasterLayer(); + } else { + _disableMapFeatures(); + hikingApp!.disableOutdoorRasterLayer(); + } + } }); }, activeColor: Colors.lightBlueAccent, @@ -202,7 +214,8 @@ class _MyAppState extends State with WidgetsBindingObserver { Align( alignment: Alignment.bottomCenter, child: Container( - margin: EdgeInsets.only(bottom: MediaQuery.of(context).size.height * 0.05), + margin: EdgeInsets.only( + bottom: MediaQuery.of(context).size.height * 0.05), width: MediaQuery.of(context).size.width * 0.6, height: MediaQuery.of(context).size.height * 0.085, decoration: BoxDecoration( @@ -243,12 +256,17 @@ class _MyAppState extends State with WidgetsBindingObserver { throw ("Initialization of ConsentEngine failed."); } - hereMapController.mapScene.loadSceneForMapScheme(MapScheme.normalDay, (MapError? error) async { + _hereMapController = hereMapController; + + // Load the map scene using a map scheme to render the map with. + hereMapController.mapScene.loadSceneForMapScheme(MapScheme.topoDay, + (MapError? error) async { _updateMessageState("Loading MapView ..."); if (error == null) { // 1. Before we start the app we want to ensure that the required permissions are handled. if (!await _requestPermissions()) { - await _showDialog("Error", "Cannot start app: Location service and permissions are needed for this app."); + await _showDialog("Error", + "Cannot start app: Location service and permissions are needed for this app."); // Let the user set the permissions from the system settings as fallback. openAppSettings(); SystemNavigator.pop(); @@ -264,14 +282,17 @@ class _MyAppState extends State with WidgetsBindingObserver { // 3. User has granted required permissions and made a consent decision. _updateMessageState("MapView loaded"); - - String message = "For this example app, an outdoor layer from thunderforest.com is used. " + - "Without setting a valid API key, these raster tiles will show a watermark (terms of usage: https://www.thunderforest.com/terms/)." + - "\n Attribution for the outdoor layer: \n Maps © www.thunderforest.com, \n Data © www.osm.org/copyright."; + + String message = + "For this example app, an outdoor layer from thunderforest.com is used. " + + "Without setting a valid API key, these raster tiles will show a watermark (terms of usage: https://www.thunderforest.com/terms/)." + + "\n Attribution for the outdoor layer: \n Maps © www.thunderforest.com, \n Data © www.osm.org/copyright."; _showDialog("Note", message); - hikingApp = HikingApp(context, hereMapController, widget.messageNotifier); + hikingApp = + HikingApp(context, hereMapController, widget.messageNotifier); + _enableMapFeatures(); setState(() { _isLocationPermissionGranted = true; @@ -282,6 +303,36 @@ class _MyAppState extends State with WidgetsBindingObserver { }); } + // Enhance the scene with map features suitable for hiking trips. + void _enableMapFeatures() { + _hereMapController?.mapScene + .enableFeatures({MapFeatures.terrain: MapFeatureModes.terrain3d}); + _hereMapController?.mapScene + .enableFeatures({MapFeatures.contours: MapFeatureModes.contoursAll}); + _hereMapController?.mapScene.enableFeatures({ + MapFeatures.buildingFootprints: MapFeatureModes.buildingFootprintsAll + }); + _hereMapController?.mapScene.enableFeatures( + {MapFeatures.extrudedBuildings: MapFeatureModes.extrudedBuildingsAll}); + _hereMapController?.mapScene.enableFeatures( + {MapFeatures.landmarks: MapFeatureModes.landmarksTextured}); + } + + // When a custom raster outdoor layer is shown, we do not need to load hidden map features to save bandwidth. + void _disableMapFeatures() { + _hereMapController?.mapScene + .enableFeatures({MapFeatures.terrain: MapFeatureModes.terrain3d}); + _hereMapController?.mapScene + .enableFeatures({MapFeatures.contours: MapFeatureModes.contoursAll}); + _hereMapController?.mapScene.enableFeatures({ + MapFeatures.buildingFootprints: MapFeatureModes.buildingFootprintsAll + }); + _hereMapController?.mapScene.enableFeatures( + {MapFeatures.extrudedBuildings: MapFeatureModes.extrudedBuildingsAll}); + _hereMapController?.mapScene.enableFeatures( + {MapFeatures.landmarks: MapFeatureModes.landmarksTextured}); + } + // Request permissions with the permission_handler plugin. Set the required permissions here: // Android: hiking_diary_app/android/app/src/main/AndroidManifest.xml // iOS: hiking_diary_app/ios/Runner/Info.plist @@ -316,11 +367,14 @@ class _MyAppState extends State with WidgetsBindingObserver { void _updateConsentState() { String stateMessage; if (Platform.isIOS) { - stateMessage = "Info: On iOS no consent is required as on iOS no data is collected."; + stateMessage = + "Info: On iOS no consent is required as on iOS no data is collected."; } else if (_consentEngine?.userConsentState == ConsentUserReply.granted) { - stateMessage = "Positioning consent: You have granted consent to the data collection."; + stateMessage = + "Positioning consent: You have granted consent to the data collection."; } else { - stateMessage = "Positioning consent: You have denied consent to the data collection."; + stateMessage = + "Positioning consent: You have denied consent to the data collection."; } setState(() { diff --git a/examples/latest/navigate/flutter/indoor_map_app/assets/img_ambulance.png b/examples/latest/navigate/flutter/indoor_map_app/assets/img_ambulance.png new file mode 100644 index 00000000..845af2be Binary files /dev/null and b/examples/latest/navigate/flutter/indoor_map_app/assets/img_ambulance.png differ diff --git a/examples/latest/navigate/flutter/indoor_map_app/assets/img_bike.png b/examples/latest/navigate/flutter/indoor_map_app/assets/img_bike.png new file mode 100644 index 00000000..4652db07 Binary files /dev/null and b/examples/latest/navigate/flutter/indoor_map_app/assets/img_bike.png differ diff --git a/examples/latest/navigate/flutter/indoor_map_app/assets/img_car.png b/examples/latest/navigate/flutter/indoor_map_app/assets/img_car.png new file mode 100644 index 00000000..535059cf Binary files /dev/null and b/examples/latest/navigate/flutter/indoor_map_app/assets/img_car.png differ diff --git a/examples/latest/navigate/flutter/indoor_map_app/assets/img_pedestrian.png b/examples/latest/navigate/flutter/indoor_map_app/assets/img_pedestrian.png new file mode 100644 index 00000000..fde4e9ef Binary files /dev/null and b/examples/latest/navigate/flutter/indoor_map_app/assets/img_pedestrian.png differ diff --git a/examples/latest/navigate/flutter/indoor_map_app/assets/img_taxi.png b/examples/latest/navigate/flutter/indoor_map_app/assets/img_taxi.png new file mode 100644 index 00000000..19746dfe Binary files /dev/null and b/examples/latest/navigate/flutter/indoor_map_app/assets/img_taxi.png differ diff --git a/examples/latest/navigate/flutter/indoor_map_app/lib/events.dart b/examples/latest/navigate/flutter/indoor_map_app/lib/events.dart index bdcb49d5..c3acb65a 100644 --- a/examples/latest/navigate/flutter/indoor_map_app/lib/events.dart +++ b/examples/latest/navigate/flutter/indoor_map_app/lib/events.dart @@ -29,3 +29,9 @@ class SpeceTapped with ChangeNotifier { } SpeceTapped spaceTapped = new SpeceTapped(); + +class TopologyLineTapped with ChangeNotifier { + ValueNotifier isTopologyLineTapped = ValueNotifier(false); +} + +TopologyLineTapped topologyLineTapped = new TopologyLineTapped(); diff --git a/examples/latest/navigate/flutter/indoor_map_app/lib/main.dart b/examples/latest/navigate/flutter/indoor_map_app/lib/main.dart index f6ea9a39..767a0943 100644 --- a/examples/latest/navigate/flutter/indoor_map_app/lib/main.dart +++ b/examples/latest/navigate/flutter/indoor_map_app/lib/main.dart @@ -235,11 +235,106 @@ class _MainPageState extends State { ], ), ), + ValueListenableBuilder( + valueListenable: topologyLineTapped.isTopologyLineTapped, + builder: (BuildContext context, bool isTapped, Widget? child) { + return Visibility( + visible: isTapped && _topologyPressed, + child: Positioned( + bottom: 0, + child: Container( + width: MediaQuery.of(context).size.width, + height: 250, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(20), + topRight: Radius.circular(20), + ), + boxShadow: [ + BoxShadow( + color: Colors.black26, + blurRadius: 10, + spreadRadius: 2, + ), + ], + ), + padding: EdgeInsets.all(16), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (_venueEngineState.venueTapController?.topologyDetails != null) + ..._buildRowsFromTopologyDetails(_venueEngineState.venueTapController!.topologyDetails), + ], + ), + ), + ), + ); + }, + ), ], ), ); } + List _buildRowsFromTopologyDetails(String topologyDetails) { + List rows = []; + List lines = topologyDetails.split('\n'); + + for (String line in lines) { + List rowItems = []; + List parts = line.split(' '); + int pngCount = parts.where((part) => part.endsWith('.png')).length; + + for (String part in parts) { + if (part.endsWith('.png')) { + rowItems.add( + Image.asset( + 'assets/$part', + height: 30.0, + width: 30.0, + ), + ); + } else { + rowItems.add( + Padding( + padding: const EdgeInsets.symmetric(horizontal: 4.0), + child: Text( + part, + style: TextStyle( + fontSize: 16, + ), + ), + ), + ); + } + } + + if (pngCount > 0) { + double blankSpace = 0; + if (pngCount == 1) { + blankSpace = 150.0; + } else if (pngCount == 2) { + blankSpace = 122.0; + } else if (pngCount == 3) { + blankSpace = 92.0; + } else if (pngCount >= 4) { + blankSpace = 62.0; + } + rowItems.insert(pngCount, SizedBox(width: blankSpace)); + } + + rows.add(Column( + children: [ + Row(children: rowItems), + SizedBox(height: 15.0), + ], + )); + } + + return rows; + } + Widget _buildSlidingPanel() { return Column( children: [ diff --git a/examples/latest/navigate/flutter/indoor_map_app/lib/venue_tap_controller.dart b/examples/latest/navigate/flutter/indoor_map_app/lib/venue_tap_controller.dart index fc49b1c3..c4a574e7 100644 --- a/examples/latest/navigate/flutter/indoor_map_app/lib/venue_tap_controller.dart +++ b/examples/latest/navigate/flutter/indoor_map_app/lib/venue_tap_controller.dart @@ -17,15 +17,23 @@ * License-Filename: LICENSE */ +import 'dart:ffi'; + import 'package:flutter/cupertino.dart'; import 'package:here_sdk/core.dart'; import 'package:here_sdk/mapview.dart'; +import 'package:here_sdk/src/sdk/venue/routing/venue_transport_mode.dart'; import 'package:here_sdk/venue.control.dart'; import 'package:here_sdk/venue.data.dart'; import 'package:here_sdk/venue.style.dart'; +import 'package:here_sdk/venue.dart'; import 'package:indoor_map_app/geometry_info.dart'; import 'package:indoor_map_app/image_helper.dart'; import 'events.dart'; +import 'events.dart'; + +enum TopologyDirectionality { toStart, fromStart, bidirectional, undefined } +enum VenueTransportMode { auto, taxi, motorcycle, emergencyVehicle, pedestrian } class VenueTapController { final HereMapController? hereMapController; @@ -33,17 +41,22 @@ class VenueTapController { final GeometryInfoState? geometryInfoState; String tappedSpaceName = ""; int clickCount = 0; + int lineCount = 0; + String topologyDetails = ""; MapImage? _markerImage; MapMarker? _marker; Venue? _selectedVenue; VenueGeometry? _selectedGeometry; + VenueTopology? _selectedTopology; // Create geometry and label styles for the selected geometry. final VenueGeometryStyle _geometryStyle = VenueGeometryStyle(Color.fromARGB(255, 72, 187, 245), Color.fromARGB(255, 30, 170, 235), 1); final VenueLabelStyle _labelStyle = VenueLabelStyle(Color.fromARGB(255, 255, 255, 255), Color.fromARGB(255, 0, 130, 195), 1, 28); + final VenueGeometryStyle _topologyStyle = + VenueGeometryStyle(Color.fromARGB(255, 72, 187, 245), Color.fromARGB(255, 90, 196, 193), 4); VenueTapController({required this.hereMapController, required this.venueMap, required this.geometryInfoState}) { // Get an image for MapMarker. @@ -53,6 +66,7 @@ class VenueTapController { onTap(Point2D origin) { _deselectGeometry(); + _deselectTopology(); // Get geo coordinates of the tapped point. GeoCoordinates? position = hereMapController!.viewToGeoCoordinates(origin); @@ -60,22 +74,27 @@ class VenueTapController { return; } - // Get a VenueGeometry under the tapped position. - VenueGeometry? geometry = venueMap.getGeometry(position); - if (geometry != null) { - spaceTapped.isSpaceTapped.value = false; - spaceTapped.isSpaceTapped.value = true; - clickCount = 1; - selectGeometry(geometry, position, false); - tappedSpaceName = geometry.name+ ", "+geometry.level.name; - print('tappedSpaceName : $tappedSpaceName'); + VenueTopology? topology = venueMap.getTopology(position); + if (topology != null) { + selectTopology(topology, position); } else { - spaceTapped.isSpaceTapped.value = false; - // If no geometry was tapped, check if there is a not-selected venue under - // the tapped position. If there is one, select it. - Venue? venue = venueMap.getVenue(position); - if (venue != null) { - venueMap.selectedVenue = venue; + // Get a VenueGeometry under the tapped position. + VenueGeometry? geometry = venueMap.getGeometry(position); + if (geometry != null) { + spaceTapped.isSpaceTapped.value = false; + spaceTapped.isSpaceTapped.value = true; + clickCount = 1; + selectGeometry(geometry, position, false); + tappedSpaceName = geometry.name + ", " + geometry.level.name; + print('tappedSpaceName : $tappedSpaceName'); + } else { + spaceTapped.isSpaceTapped.value = false; + // If no geometry was tapped, check if there is a not-selected venue under + // the tapped position. If there is one, select it. + Venue? venue = venueMap.getVenue(position); + if (venue != null) { + venueMap.selectedVenue = venue; + } } } } @@ -89,6 +108,91 @@ class VenueTapController { _deselectGeometry(); } + selectTopology(VenueTopology topology, GeoCoordinates position) { + topologyDetails = getTopologyInfo(topology); + _selectedTopology = topology; + if(_selectedTopology != null) { + topologyLineTapped.isTopologyLineTapped.value = true; + _selectedVenue!.setCustomStyleToTopology([topology], _topologyStyle); + } + _selectedTopology = topology; + + hereMapController!.camera.lookAtPoint(position); + } + + String getTopologyInfo(VenueTopology topology) { + StringBuffer result = StringBuffer(); + Map> vehicleGroups = {}; + String pedestrianDirectionality = " "; + lineCount = 0; + + // First line: topology ID + result.writeln(topology.identifier); + lineCount++; + + // Process accessibility + for (int i = 0; i < topology.accessibility.length; i++) { + var access = topology.accessibility[i]; + var mode = access.mode; + String imageName = ''; + + switch (mode.name) { + case 'auto': + imageName = 'img_car'; + break; + case 'taxi': + imageName = 'img_taxi'; + break; + case 'motorcycle': + imageName = 'img_bike'; + break; + case 'emergencyVehicle': + imageName = 'img_ambulance'; + break; + case 'pedestrian': + imageName = 'img_pedestrian'; + pedestrianDirectionality = access.direction.name; + break; + } + + if (mode.name == 'pedestrian') { + // Second line: pedestrian image and directionality + result.write('img_pedestrian.png '); + if (pedestrianDirectionality.isNotEmpty) { + result.writeln(pedestrianDirectionality.toUpperCase()); + lineCount++; + } + } else if (imageName.isNotEmpty) { + var direction = access.direction.name; + + vehicleGroups.putIfAbsent(direction, () => []); + vehicleGroups[direction]!.add(imageName); + } + } + + // Process vehicle groups + for (var direction in vehicleGroups.keys) { + var imageNames = vehicleGroups[direction]; + if (imageNames != null && imageNames.isNotEmpty) { + for (var imageName in imageNames) { + result.write('$imageName.png '); + } + result.writeln(direction.toUpperCase()); + lineCount++; + } + } + + return result.toString(); + } + + _deselectTopology() { + if (_selectedVenue != null && _selectedTopology != null) { + _selectedVenue!.setCustomStyleToTopology([_selectedTopology!], null); + _selectedTopology = null; + topologyLineTapped.isTopologyLineTapped.value = false; + } + } + selectGeometry(VenueGeometry geometry, GeoCoordinates position, bool center) { _deselectGeometry(); _selectedVenue = venueMap.selectedVenue; diff --git a/examples/latest/navigate/flutter/search_hybrid_app/lib/SearchExample.dart b/examples/latest/navigate/flutter/search_hybrid_app/lib/SearchExample.dart index caa3197d..69c4d41f 100644 --- a/examples/latest/navigate/flutter/search_hybrid_app/lib/SearchExample.dart +++ b/examples/latest/navigate/flutter/search_hybrid_app/lib/SearchExample.dart @@ -241,6 +241,9 @@ class SearchExample { // search results may not be available for all zoom levels. // Please also note that it may take time until the required map data is loaded. // Subsequently, the cache is filled when a user pans and zooms the map. + // + // For best results, it is recommended to permanently install offline region data and use the + // OfflineSearchEngine for areas where region data has been installed. _showDialog("Search", "Error: " + searchError.toString()); return; } diff --git a/examples/latest/navigate/flutter/spatial_audio_navigation/lib/main.dart b/examples/latest/navigate/flutter/spatial_audio_navigation/lib/main.dart index 6f013ea6..d8b326ae 100644 --- a/examples/latest/navigate/flutter/spatial_audio_navigation/lib/main.dart +++ b/examples/latest/navigate/flutter/spatial_audio_navigation/lib/main.dart @@ -57,7 +57,7 @@ class MyApp extends StatefulWidget { class _MyAppState extends State { static const methodChannel = MethodChannel('com.here.sdk.example/spatialAudioExample'); - late HERE.SpatialManeuverAudioCuePanning audioCuePanning; + late HERE.SpatialAudioCuePanning spatialAudioCuePanning; HereMapController? _hereMapController; @@ -153,19 +153,18 @@ class _MyAppState extends State { // This enables a navigation view including a rendered navigation arrow. _visualNavigator!.startRendering(_hereMapController!); - // Hook in one of the many listeners. Here we set up a listener to get instructions on the spatial maneuvers to take while driving. - _visualNavigator!.spatialManeuverNotificationListener = HERE.SpatialManeuverNotificationListener( - (HERE.SpatialManeuver spatialManeuver, HERE.SpatialManeuverAudioCuePanning audioCuePanning) { - String maneuverText = spatialManeuver.voiceText; - print("SpatialManeuverNotification: $maneuverText"); - synthesizeAudioCueAndPlay(spatialManeuver, audioCuePanning); - }); + // Event text options can be used for enabling the trigger for spatial audio details. + HERE.EventTextOptions eventTextOptions = HERE.EventTextOptions(); + eventTextOptions.enableSpatialAudio = true; - _visualNavigator!.spatialManeuverAzimuthListener = - HERE.SpatialManeuverAzimuthListener((HERE.SpatialTrajectoryData spatialTrajectoryData) { - double azimuthInDegrees = spatialTrajectoryData.azimuthInDegrees; - print("SpatialManeuverAzimuthNotification: $azimuthInDegrees"); - notifyAzimuth(spatialTrajectoryData); + _visualNavigator!.eventTextOptions = eventTextOptions; + + _visualNavigator!.eventTextListener = HERE.EventTextListener((eventText) { + String maneuverText = eventText.text; + print("SpatialManeuverNotification: $maneuverText"); + if (eventText.spatialNotificationDetails != null) { + synthesizeSpatialAudioCueAndPlay(eventText); + } }); // Set a route to follow. This leaves tracking mode. @@ -224,12 +223,14 @@ class _MyAppState extends State { ); } - Future synthesizeAudioCueAndPlay( - HERE.SpatialManeuver spatialManeuver, HERE.SpatialManeuverAudioCuePanning audioCuePanning) async { - this.audioCuePanning = audioCuePanning; - - await methodChannel.invokeMethod('synthesizeAudioCueAndPlay', - {'audioCue': spatialManeuver.maneuver.text, 'initialAzimuth': spatialManeuver.initialAzimuthInDegrees}); + Future synthesizeSpatialAudioCueAndPlay(HERE.EventText eventText) async { + this.spatialAudioCuePanning = + eventText.spatialNotificationDetails!.audioCuePanning; + await methodChannel.invokeMethod('synthesizeAudioCueAndPlay', { + 'audioCue': eventText.text, + 'initialAzimuth': + eventText.spatialNotificationDetails!.initialAzimuthInDegrees + }); } Future notifyAzimuth(HERE.SpatialTrajectoryData spatialTrajectoryData) async { @@ -247,9 +248,13 @@ class _MyAppState extends State { // Use the length obtained platform based in order to improve the audio cue duration estimation. final lengthMs = call.arguments as int; Duration duration = new Duration(milliseconds: lengthMs); - HERE.CustomPanningData customPanningData = new HERE.CustomPanningData(duration, null, null); - - audioCuePanning.startPanning(customPanningData); + HERE.CustomPanningData customPanningData = + new HERE.CustomPanningData(duration, null, null); + spatialAudioCuePanning.startAngularPanning(customPanningData, + (spatialTrajectoryData) { + notifyAzimuth(spatialTrajectoryData); + }); + // audioCuePanning.startPanning(customPanningData); break; } } diff --git a/examples/latest/navigate/ios/Camera/Camera.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/Camera/Camera.xcodeproj/project.pbxproj index 6d523322..f658290d 100644 --- a/examples/latest/navigate/ios/Camera/Camera.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/Camera/Camera.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ - C827C5432329371C003AA0C5 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C827C5422329371C003AA0C5 /* AppDelegate.swift */; }; - C827C5452329371C003AA0C5 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C827C5442329371C003AA0C5 /* ViewController.swift */; }; - C827C5482329371C003AA0C5 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C827C5462329371C003AA0C5 /* Main.storyboard */; }; - C827C54A23293725003AA0C5 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C827C54923293725003AA0C5 /* Assets.xcassets */; }; - C827C54D23293726003AA0C5 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */; }; - C827C555232938B2003AA0C5 /* CameraExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C827C554232938B2003AA0C5 /* CameraExample.swift */; }; - C88C019223CDFDD600043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C019123CDFDD500043918 /* heresdk.xcframework */; }; - C88C019323CDFDD600043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C019123CDFDD500043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 83C837BC2C207F340004F54E /* CameraApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* CameraApp.swift */; }; + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BD2C207F340004F54E /* ContentView.swift */; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* CameraExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* CameraExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C827C559232938DA003AA0C5 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C019323CDFDD600043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,64 +31,68 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C827C53F2329371C003AA0C5 /* Camera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Camera.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C827C5422329371C003AA0C5 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C827C5442329371C003AA0C5 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C827C5472329371C003AA0C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C827C54923293725003AA0C5 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C827C54C23293726003AA0C5 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C827C54E23293726003AA0C5 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C827C554232938B2003AA0C5 /* CameraExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraExample.swift; sourceTree = ""; }; - C88C019123CDFDD500043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Camera.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Camera.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* CameraApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraApp.swift; sourceTree = ""; }; + 83C837BD2C207F340004F54E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 83C837BF2C207F360004F54E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 83C837C22C207F360004F54E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837D02C20EFA70004F54E /* CameraExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C827C53C2329371C003AA0C5 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C019223CDFDD600043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C827C5362329371C003AA0C5 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C827C5412329371C003AA0C5 /* Camera */, - C827C5402329371C003AA0C5 /* Products */, - C88C019023CDFDD400043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* Camera */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C827C5402329371C003AA0C5 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C827C53F2329371C003AA0C5 /* Camera.app */, + 83C837B82C207F340004F54E /* Camera.app */, ); name = Products; sourceTree = ""; }; - C827C5412329371C003AA0C5 /* Camera */ = { + 83C837BA2C207F340004F54E /* Camera */ = { isa = PBXGroup; children = ( - C827C5422329371C003AA0C5 /* AppDelegate.swift */, - C827C5442329371C003AA0C5 /* ViewController.swift */, - C827C554232938B2003AA0C5 /* CameraExample.swift */, - C827C5462329371C003AA0C5 /* Main.storyboard */, - C827C54923293725003AA0C5 /* Assets.xcassets */, - C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */, - C827C54E23293726003AA0C5 /* Info.plist */, + 83C837BB2C207F340004F54E /* CameraApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* CameraExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = Camera; sourceTree = ""; }; - C88C019023CDFDD400043918 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C88C019123CDFDD500043918 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -97,14 +100,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C827C53E2329371C003AA0C5 /* Camera */ = { + 83C837B72C207F340004F54E /* Camera */ = { isa = PBXNativeTarget; - buildConfigurationList = C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "Camera" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Camera" */; buildPhases = ( - C827C53B2329371C003AA0C5 /* Sources */, - C827C53C2329371C003AA0C5 /* Frameworks */, - C827C53D2329371C003AA0C5 /* Resources */, - C827C559232938DA003AA0C5 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -112,97 +115,76 @@ ); name = Camera; productName = Camera; - productReference = C827C53F2329371C003AA0C5 /* Camera.app */; + productReference = 83C837B82C207F340004F54E /* Camera.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C827C5372329371C003AA0C5 /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1030; - LastUpgradeCheck = 1250; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C827C53E2329371C003AA0C5 = { - CreatedOnToolsVersion = 10.3; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C827C53A2329371C003AA0C5 /* Build configuration list for PBXProject "Camera" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Camera" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C827C5362329371C003AA0C5; - productRefGroup = C827C5402329371C003AA0C5 /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C827C53E2329371C003AA0C5 /* Camera */, + 83C837B72C207F340004F54E /* Camera */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C827C53D2329371C003AA0C5 /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C827C54D23293726003AA0C5 /* LaunchScreen.storyboard in Resources */, - C827C54A23293725003AA0C5 /* Assets.xcassets in Resources */, - C827C5482329371C003AA0C5 /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C827C53B2329371C003AA0C5 /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C827C555232938B2003AA0C5 /* CameraExample.swift in Sources */, - C827C5452329371C003AA0C5 /* ViewController.swift in Sources */, - C827C5432329371C003AA0C5 /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* CameraApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* CameraExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C827C5462329371C003AA0C5 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C827C5472329371C003AA0C5 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C827C54C23293726003AA0C5 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C827C54F23293726003AA0C5 /* Debug */ = { + 83C837C42C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -228,12 +210,12 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -247,24 +229,25 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - C827C55023293726003AA0C5 /* Release */ = { + 83C837C52C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -290,12 +273,12 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -303,59 +286,71 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; - C827C55223293726003AA0C5 /* Debug */ = { + 83C837C72C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Camera/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Camera/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - C827C55323293726003AA0C5 /* Release */ = { + 83C837C82C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Camera/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Camera/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -364,25 +359,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C827C53A2329371C003AA0C5 /* Build configuration list for PBXProject "Camera" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Camera" */ = { isa = XCConfigurationList; buildConfigurations = ( - C827C54F23293726003AA0C5 /* Debug */, - C827C55023293726003AA0C5 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "Camera" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Camera" */ = { isa = XCConfigurationList; buildConfigurations = ( - C827C55223293726003AA0C5 /* Debug */, - C827C55323293726003AA0C5 /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C827C5372329371C003AA0C5 /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,98 +1,13 @@ { "images" : [ { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/Camera/Camera/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/Camera/Camera/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/Camera/Camera/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/navigate/ios/Camera/Camera/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/Camera/Camera/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/Camera/Camera/Base.lproj/Main.storyboard deleted file mode 100644 index 37a4f1b8..00000000 --- a/examples/latest/navigate/ios/Camera/Camera/Base.lproj/Main.storyboard +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Routing/Routing/AppDelegate.swift b/examples/latest/navigate/ios/Camera/Camera/CameraApp.swift similarity index 63% rename from examples/latest/explore/ios/Routing/Routing/AppDelegate.swift rename to examples/latest/navigate/ios/Camera/Camera/CameraApp.swift index 5c8c8eef..a110a442 100644 --- a/examples/latest/explore/ios/Routing/Routing/AppDelegate.swift +++ b/examples/latest/navigate/ios/Camera/Camera/CameraApp.swift @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 HERE Europe B.V. + * Copyright (C) 2022-2024 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,20 +18,34 @@ */ import heresdk -import UIKit +import SwiftUI -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. +// This class is the entry point to an application. +// HERE SDK initialization is done at start of app. When app is terminated, the HERE SDK is disposed. +@main +struct CameraApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } + + init() { + observeAppLifecycle() + // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. initializeHERESDK() - - return true + } + + private func observeAppLifecycle() { + NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, + object: nil, + queue: nil) { _ in + // Perform cleanup or final tasks here. + print("App is about to terminate.") + disposeHERESDK() + } } private func initializeHERESDK() { @@ -45,15 +59,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") } } - + private func disposeHERESDK() { // Free HERE SDK resources before the application shuts down. // Usually, this should be called only on application termination. - // Afterwards, the HERE SDK is no longer usable unless it is initialized again. + + // After this call, the HERE SDK is no longer usable unless it is initialized again. SDKNativeEngine.sharedInstance = nil } - - func applicationWillTerminate(_ application: UIApplication) { - disposeHERESDK() - } } diff --git a/examples/latest/navigate/ios/Camera/Camera/CameraExample.swift b/examples/latest/navigate/ios/Camera/Camera/CameraExample.swift index a161deec..16be4379 100644 --- a/examples/latest/navigate/ios/Camera/Camera/CameraExample.swift +++ b/examples/latest/navigate/ios/Camera/Camera/CameraExample.swift @@ -26,16 +26,15 @@ import UIKit class CameraExample: TapDelegate, MapCameraDelegate { private let defaultDistanceToEarthInMeters: Double = 8000 - private let viewController: UIViewController private let mapView: MapView private let camera: MapCamera private var cameraTargetView: UIImageView private var poiMapCircle: MapPolygon! - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView + // Configure the map. camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: defaultDistanceToEarthInMeters) camera.lookAt(point: GeoCoordinates(latitude: 52.750731,longitude: 13.007375), @@ -56,9 +55,19 @@ class CameraExample: TapDelegate, MapCameraDelegate { mapView.gestures.tapDelegate = self mapView.camera.addDelegate(self) + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) + showDialog(title: "Note", message: "Tap the map to set a new transform center.") } + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } + func onRotateButtonClicked() { rotateMap(bearingStepInDegrees: 10) } @@ -164,8 +173,19 @@ class CameraExample: TapDelegate, MapCameraDelegate { } private func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - viewController.present(alertController, animated: true, completion: nil) + if let topController = UIApplication.shared.windows.first?.rootViewController { + let alert = UIAlertController( + title: title, + message: message, + preferredStyle: .alert + ) + + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in + // Handle OK button action. + alert.dismiss(animated: true, completion: nil) + })) + + topController.present(alert, animated: true, completion: nil) + } } } diff --git a/examples/latest/navigate/ios/Camera/Camera/ContentView.swift b/examples/latest/navigate/ios/Camera/Camera/ContentView.swift new file mode 100644 index 00000000..73dfa2a1 --- /dev/null +++ b/examples/latest/navigate/ios/Camera/Camera/ContentView.swift @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +struct ContentView: View { + + @State private var mapView = MapView() + @State private var cameraExample: CameraExample? + + var body: some View { + // Show the views on top of each other. + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + + HStack { + CustomButton(title: "Rotate") { + cameraExample?.onRotateButtonClicked() + } + CustomButton(title: "Tilt") { + cameraExample?.onTiltButtonClicked() + } + CustomButton(title: "Move") { + cameraExample?.onMoveToXYButtonClicked() + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + cameraExample = CameraExample(mapView) + } + } +} + +// The MapView provided by the HERE SDK conforms to a UIKit view, so it needs to be wrapped to conform +// to a SwiftUI view. The map view is created in the ContentView and bound here. +private struct WrappedMapView: UIViewRepresentable { + @Binding var mapView: MapView + func makeUIView(context: Context) -> MapView { return mapView } + func updateUIView(_ mapView: MapView, context: Context) { } +} + +// A reusable button to keep the layout clean. +struct CustomButton: View { + let title: String + let action: () -> Void + + var body: some View { + Button(action: action) { + Text(title) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/examples/latest/navigate/ios/Camera/Camera/Info.plist b/examples/latest/navigate/ios/Camera/Camera/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/Camera/Camera/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/latest/navigate/ios/Camera/Camera/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Camera/Camera/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/Camera/Camera/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/Camera/Camera/ViewController.swift b/examples/latest/navigate/ios/Camera/Camera/ViewController.swift deleted file mode 100644 index d051ba91..00000000 --- a/examples/latest/navigate/ios/Camera/Camera/ViewController.swift +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -final class ViewController: UIViewController { - - @IBOutlet private var mapView: MapView! - private var cameraExample: CameraExample! - private var isMapSceneLoaded = false - - override func viewDidLoad() { - super.viewDidLoad() - - // Load the map scene using a map style to render the map with. - mapView.mapScene.loadScene(mapScheme: .normalDay, completion: onLoadScene) - } - - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - // Start the example. - cameraExample = CameraExample(viewController: self, mapView: mapView) - isMapSceneLoaded = true - } - - @IBAction func onRotateButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraExample.onRotateButtonClicked() - } - } - - @IBAction func onTiltButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraExample.onTiltButtonClicked() - } - } - - @IBAction func onMoveToXYButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraExample.onMoveToXYButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/Camera/README.md b/examples/latest/navigate/ios/Camera/README.md index 180976ae..f5c981cd 100644 --- a/examples/latest/navigate/ios/Camera/README.md +++ b/examples/latest/navigate/ios/Camera/README.md @@ -1,4 +1,4 @@ -The Canera example app shows how to change the target anchor point and how to move to another location using animations. You can find how this is done in [CameraExample.swift](Camera/CameraExample.swift). +The Camera example app shows how to change the target anchor point and how to move to another location using animations. You can find how this is done in [CameraExample.swift](Camera/CameraExample.swift). Build instructions: ------------------- diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking.xcodeproj/project.pbxproj index 472b5bc9..4888be7e 100644 --- a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking.xcodeproj/project.pbxproj @@ -3,27 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ - C865244320B8138000392D48 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C865244220B8138000392D48 /* AppDelegate.swift */; }; - C865244520B8138000392D48 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C865244420B8138000392D48 /* ViewController.swift */; }; - C865244820B8138000392D48 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C865244620B8138000392D48 /* Main.storyboard */; }; - C865244A20B8138200392D48 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C865244920B8138200392D48 /* Assets.xcassets */; }; - C865244D20B8138200392D48 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C865244B20B8138200392D48 /* LaunchScreen.storyboard */; }; - C88C016E23CDFC9600043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C016D23CDFC9600043918 /* heresdk.xcframework */; }; - C88C016F23CDFC9600043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C016D23CDFC9600043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 83C837BC2C207F340004F54E /* CartoPOIPickingApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* CartoPOIPickingApp.swift */; }; + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BD2C207F340004F54E /* ContentView.swift */; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* CartoPOIPickingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* CartoPOIPickingExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C8CE86F52236D58700701A47 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C016F23CDFC9600043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -31,62 +31,68 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C865243F20B8138000392D48 /* CartoPOIPicking.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CartoPOIPicking.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C865244220B8138000392D48 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C865244420B8138000392D48 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C865244720B8138000392D48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C865244920B8138200392D48 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C865244C20B8138200392D48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C865244E20B8138200392D48 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C88C016D23CDFC9600043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* CartoPOIPicking.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CartoPOIPicking.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* CartoPOIPickingApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartoPOIPickingApp.swift; sourceTree = ""; }; + 83C837BD2C207F340004F54E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 83C837BF2C207F360004F54E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 83C837C22C207F360004F54E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837D02C20EFA70004F54E /* CartoPOIPickingExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartoPOIPickingExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C865243C20B8138000392D48 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C016E23CDFC9600043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C865243620B8138000392D48 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C865244120B8138000392D48 /* CartoPOIPicking */, - C865244020B8138000392D48 /* Products */, - C88C016C23CDFC9600043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* CartoPOIPicking */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C865244020B8138000392D48 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C865243F20B8138000392D48 /* CartoPOIPicking.app */, + 83C837B82C207F340004F54E /* CartoPOIPicking.app */, ); name = Products; sourceTree = ""; }; - C865244120B8138000392D48 /* CartoPOIPicking */ = { + 83C837BA2C207F340004F54E /* CartoPOIPicking */ = { isa = PBXGroup; children = ( - C865244220B8138000392D48 /* AppDelegate.swift */, - C865244420B8138000392D48 /* ViewController.swift */, - C865244620B8138000392D48 /* Main.storyboard */, - C865244920B8138200392D48 /* Assets.xcassets */, - C865244B20B8138200392D48 /* LaunchScreen.storyboard */, - C865244E20B8138200392D48 /* Info.plist */, + 83C837BB2C207F340004F54E /* CartoPOIPickingApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* CartoPOIPickingExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = CartoPOIPicking; sourceTree = ""; }; - C88C016C23CDFC9600043918 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C88C016D23CDFC9600043918 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -94,14 +100,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C865243E20B8138000392D48 /* CartoPOIPicking */ = { + 83C837B72C207F340004F54E /* CartoPOIPicking */ = { isa = PBXNativeTarget; - buildConfigurationList = C865245120B8138200392D48 /* Build configuration list for PBXNativeTarget "CartoPOIPicking" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CartoPOIPicking" */; buildPhases = ( - C865243B20B8138000392D48 /* Sources */, - C865243C20B8138000392D48 /* Frameworks */, - C865243D20B8138000392D48 /* Resources */, - C8CE86F52236D58700701A47 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -109,97 +115,76 @@ ); name = CartoPOIPicking; productName = CartoPOIPicking; - productReference = C865243F20B8138000392D48 /* CartoPOIPicking.app */; + productReference = 83C837B82C207F340004F54E /* CartoPOIPicking.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C865243720B8138000392D48 /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0930; - LastUpgradeCheck = 0930; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C865243E20B8138000392D48 = { - CreatedOnToolsVersion = 9.3; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C865243A20B8138000392D48 /* Build configuration list for PBXProject "CartoPOIPicking" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CartoPOIPicking" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C865243620B8138000392D48; - productRefGroup = C865244020B8138000392D48 /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C865243E20B8138000392D48 /* CartoPOIPicking */, + 83C837B72C207F340004F54E /* CartoPOIPicking */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C865243D20B8138000392D48 /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C865244D20B8138200392D48 /* LaunchScreen.storyboard in Resources */, - C865244A20B8138200392D48 /* Assets.xcassets in Resources */, - C865244820B8138000392D48 /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C865243B20B8138000392D48 /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C865244520B8138000392D48 /* ViewController.swift in Sources */, - C865244320B8138000392D48 /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* CartoPOIPickingApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* CartoPOIPickingExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C865244620B8138000392D48 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C865244720B8138000392D48 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C865244B20B8138200392D48 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C865244C20B8138200392D48 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C865244F20B8138200392D48 /* Debug */ = { + 83C837C42C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -218,18 +203,19 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -243,23 +229,25 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; - MTL_ENABLE_DEBUG_INFO = YES; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - C865245020B8138200392D48 /* Release */ = { + 83C837C52C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -278,18 +266,19 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -297,58 +286,71 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; - C865245220B8138200392D48 /* Debug */ = { + 83C837C72C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"CartoPOIPicking/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CartoPOIPicking/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - C865245320B8138200392D48 /* Release */ = { + 83C837C82C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"CartoPOIPicking/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CartoPOIPicking/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -357,25 +359,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C865243A20B8138000392D48 /* Build configuration list for PBXProject "CartoPOIPicking" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CartoPOIPicking" */ = { isa = XCConfigurationList; buildConfigurations = ( - C865244F20B8138200392D48 /* Debug */, - C865245020B8138200392D48 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C865245120B8138200392D48 /* Build configuration list for PBXNativeTarget "CartoPOIPicking" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CartoPOIPicking" */ = { isa = XCConfigurationList; buildConfigurations = ( - C865245220B8138200392D48 /* Debug */, - C865245320B8138200392D48 /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C865243720B8138000392D48 /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/AppDelegate.swift b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/AppDelegate.swift +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - - // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. - initializeHERESDK() - - return true - } - - private func initializeHERESDK() { - // Set your credentials for the HERE SDK. - let accessKeyID = "YOUR_ACCESS_KEY_ID" - let accessKeySecret = "YOUR_ACCESS_KEY_SECRET" - let options = SDKOptions(accessKeyId: accessKeyID, accessKeySecret: accessKeySecret) - do { - try SDKNativeEngine.makeSharedInstance(options: options) - } catch let engineInstantiationError { - fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") - } - } - - private func disposeHERESDK() { - // Free HERE SDK resources before the application shuts down. - // Usually, this should be called only on application termination. - // Afterwards, the HERE SDK is no longer usable unless it is initialized again. - SDKNativeEngine.sharedInstance = nil - } - - func applicationWillTerminate(_ application: UIApplication) { - disposeHERESDK() - } -} diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,98 +1,13 @@ { "images" : [ { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f83f6fd5..00000000 --- a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Base.lproj/Main.storyboard deleted file mode 100644 index 20e2e906..00000000 --- a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Base.lproj/Main.storyboard +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/CartoPOIPickingApp.swift b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/CartoPOIPickingApp.swift new file mode 100644 index 00000000..bb8815db --- /dev/null +++ b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/CartoPOIPickingApp.swift @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +// This class is the entry point to an application. +// HERE SDK initialization is done at start of app. When app is terminated, the HERE SDK is disposed. +@main +struct CartoPOIPickingApp: App { + + var body: some Scene { + WindowGroup { + ContentView() + } + } + + init() { + observeAppLifecycle() + + // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. + initializeHERESDK() + } + + private func observeAppLifecycle() { + NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, + object: nil, + queue: nil) { _ in + // Perform cleanup or final tasks here. + print("App is about to terminate.") + disposeHERESDK() + } + } + + private func initializeHERESDK() { + // Set your credentials for the HERE SDK. + let accessKeyID = "YOUR_ACCESS_KEY_ID" + let accessKeySecret = "YOUR_ACCESS_KEY_SECRET" + let options = SDKOptions(accessKeyId: accessKeyID, accessKeySecret: accessKeySecret) + do { + try SDKNativeEngine.makeSharedInstance(options: options) + } catch let engineInstantiationError { + fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") + } + } + + private func disposeHERESDK() { + // Free HERE SDK resources before the application shuts down. + // Usually, this should be called only on application termination. + + // After this call, the HERE SDK is no longer usable unless it is initialized again. + SDKNativeEngine.sharedInstance = nil + } +} diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/ViewController.swift b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/CartoPOIPickingExample.swift similarity index 88% rename from examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/ViewController.swift rename to examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/CartoPOIPickingExample.swift index ee2854e7..e3cc7d2a 100644 --- a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/ViewController.swift +++ b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/CartoPOIPickingExample.swift @@ -20,47 +20,47 @@ import heresdk import UIKit -class ViewController: UIViewController, TapDelegate { - - @IBOutlet var mapView: MapView! - - private var offlineSearchEngine: OfflineSearchEngine? - - override func viewDidLoad() { - super.viewDidLoad() - +class CartoPOIPickingExample: TapDelegate { + + private var mapView: MapView + private var offlineSearchEngine: OfflineSearchEngine + + init(_ mapView: MapView) { + self.mapView = mapView + + // Configure the map. + let camera = mapView.camera + let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) + camera.lookAt(point: GeoCoordinates(latitude: 52.518043, longitude: 13.405991), + zoom: distanceInMeters) + + do { + // Allows to search on already downloaded or cached map data. + try offlineSearchEngine = OfflineSearchEngine() + } catch let engineInstantiationError { + fatalError("Failed to initialize OfflineSearchEngine. Cause: \(engineInstantiationError)") + } + // Load the map scene using a map scheme to render the map with. mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) } - + + // Completion handler for loadScene(). private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { + if let mapError = mapError { print("Error: Map scene not loaded, \(String(describing: mapError))") return } - - // Configure the map. - let camera = mapView.camera - let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) - camera.lookAt(point: GeoCoordinates(latitude: 52.518043, longitude: 13.405991), - zoom: distanceInMeters) - + startExample() } - + private func startExample() { showDialog(title: "Tap on Map Content", message: "This app shows how to pick vehicle restrictions and embedded markers on the map, such as subway stations and ATMs.") enableVehicleRestrictionsOnMap() - do { - // Allows to search on already downloaded or cached map data. - try offlineSearchEngine = OfflineSearchEngine() - } catch let engineInstantiationError { - fatalError("Failed to initialize OfflineSearchEngine. Cause: \(engineInstantiationError)") - } - // Setting a tap handler to pick embedded map content. mapView.gestures.tapDelegate = self } @@ -125,7 +125,7 @@ class ViewController: UIViewController, TapDelegate { private func fetchCartoPOIDetails(_ offlineSearchId: String) { // Set nil for LanguageCode to get the results in their local language. let languageCode: LanguageCode? = nil - offlineSearchEngine?.search(placeIdQuery: PlaceIdQuery(offlineSearchId), + offlineSearchEngine.search(placeIdQuery: PlaceIdQuery(offlineSearchId), languageCode: languageCode, completion: onSearchCompleted) } @@ -148,7 +148,6 @@ class ViewController: UIViewController, TapDelegate { // See Traffic example app. } - private func handlePickedVehicleRestrictions(_ vehicleRestrictions: [PickMapContentResult.VehicleRestrictionResult]) { if vehicleRestrictions.count == 0 { return @@ -174,15 +173,21 @@ class ViewController: UIViewController, TapDelegate { // GDF time domains format according to ISO 14825. print("VR TimeIntervals: " + topmostVehicleRestriction.timeIntervals); } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } - + private func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - present(alertController, animated: true, completion: nil) + if let topController = UIApplication.shared.windows.first?.rootViewController { + let alert = UIAlertController( + title: title, + message: message, + preferredStyle: .alert + ) + + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in + // Handle OK button action. + alert.dismiss(animated: true, completion: nil) + })) + + topController.present(alert, animated: true, completion: nil) + } } } diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/ContentView.swift b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/ContentView.swift new file mode 100644 index 00000000..e08a944a --- /dev/null +++ b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/ContentView.swift @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +struct ContentView: View { + + @State private var mapView = MapView() + @State private var cartoPOIPickingExample: CartoPOIPickingExample? + + var body: some View { + // Show the views on top of each other. + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + } + .onAppear { + // ContentView appeared, now we init the example. + cartoPOIPickingExample = CartoPOIPickingExample(mapView) + } + } +} + +// The MapView provided by the HERE SDK conforms to a UIKit view, so it needs to be wrapped to conform +// to a SwiftUI view. The map view is created in the ContentView and bound here. +private struct WrappedMapView: UIViewRepresentable { + @Binding var mapView: MapView + func makeUIView(context: Context) -> MapView { return mapView } + func updateUIView(_ mapView: MapView, context: Context) { } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Info.plist b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/CartoPOIPicking/CartoPOIPicking/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/EVRouting/EVRouting/RoutingExample.swift b/examples/latest/navigate/ios/EVRouting/EVRouting/RoutingExample.swift index eb13c059..ef67a4db 100644 --- a/examples/latest/navigate/ios/EVRouting/EVRouting/RoutingExample.swift +++ b/examples/latest/navigate/ios/EVRouting/EVRouting/RoutingExample.swift @@ -280,7 +280,7 @@ class RoutingExample { let isolineOptions = IsolineOptions(calculationOptions: calculationOptions, evCarOptions: getEVCarOptions()) - routingEngine.calculateIsoline(center: Waypoint(coordinates: startGeoCoordinates), + isolineRoutingEngine.calculateIsoline(center: Waypoint(coordinates: startGeoCoordinates), isolineOptions: isolineOptions) { (routingError, isolines) in if let error = routingError { diff --git a/examples/latest/navigate/ios/HikingDiary/HikingDiary/ViewController.swift b/examples/latest/navigate/ios/HikingDiary/HikingDiary/ViewController.swift index cc2f8d88..5f1d5684 100644 --- a/examples/latest/navigate/ios/HikingDiary/HikingDiary/ViewController.swift +++ b/examples/latest/navigate/ios/HikingDiary/HikingDiary/ViewController.swift @@ -27,35 +27,56 @@ class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - + // Load the map scene using a map scheme to render the map with. - mapView.mapScene.loadScene(mapScheme: MapScheme.satellite, completion: onLoadScene) + mapView.mapScene.loadScene(mapScheme: MapScheme.topoDay, completion: onLoadScene) } - + override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) - + let message = "For this example app, an outdoor layer from thunderforest.com is used. Without setting a valid API key, these raster tiles will show a watermark (terms of usage: https://www.thunderforest.com/terms/).\n Attribution for the outdoor layer: \n Maps © www.thunderforest.com, \n Data © www.osm.org/copyright." showDialog(title: "Note", message: message) } - + // Completion handler when loading a map scene. private func onLoadScene(mapError: MapError?) { if let error = mapError { print("Error: Map scene not loaded, \(error)") } else { hikingApp = HikingApp(mapView: mapView) + enableMapFeatures() } } + + // Enhance the scene with map features suitable for hiking trips. + private func enableMapFeatures() { + mapView.mapScene.enableFeatures([MapFeatures.terrain: MapFeatureModes.terrain3d, + MapFeatures.contours: MapFeatureModes.contoursAll, + MapFeatures.buildingFootprints : MapFeatureModes.buildingFootprintsAll, + MapFeatures.extrudedBuildings : MapFeatureModes.extrudedBuildingsAll, + MapFeatures.landmarks : MapFeatureModes.landmarksTextured]) + } + + // When a custom raster outdoor layer is shown, we do not need to load hidden map features to save bandwidth. + private func disableMapFeatures() { + mapView.mapScene.disableFeatures([MapFeatures.terrain, + MapFeatures.contours, + MapFeatures.buildingFootprints, + MapFeatures.extrudedBuildings, + MapFeatures.landmarks]) + } @IBAction func schemaSwitch(_ sender: UISwitch) { if sender.isOn { + disableMapFeatures() hikingApp?.enableOutdoorRasterLayer() } else if !sender.isOn { + enableMapFeatures() hikingApp?.disableOutdoorRasterLayer() } } - + @IBAction func onEnableButtonClicked(_ sender: Any) { hikingApp?.onStartHikingButtonClicked() } @@ -77,25 +98,25 @@ class ViewController: UIViewController { performSegue(withIdentifier: "showMenu", sender: mapView) } } - + // Open the menu. override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "showMenu" { let menuViewController = segue.destination as? MenuViewController - + menuViewController?.entryKeys = hikingApp?.getMenuEntryKeys() ?? [] menuViewController?.entryText = hikingApp?.getMenuEntryDescriptions() ?? [] - + menuViewController?.setSelectedIndexListener { index in self.hikingApp?.loadDiaryEntry(index: index) } - + menuViewController?.setDeletedIndexListener { index in self.hikingApp?.deleteDiaryEntry(index: index) } } } - + func showDialog(title: String, message: String) { let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) diff --git a/examples/latest/navigate/ios/IndoorMap/IndoorMap/ViewController.swift b/examples/latest/navigate/ios/IndoorMap/IndoorMap/ViewController.swift index 93380fc8..db30c45e 100644 --- a/examples/latest/navigate/ios/IndoorMap/IndoorMap/ViewController.swift +++ b/examples/latest/navigate/ios/IndoorMap/IndoorMap/ViewController.swift @@ -409,6 +409,9 @@ class ViewController: UIViewController, UIGestureRecognizerDelegate, VenueInfoLi @objc func topologyIconTapped() { topologyVisibility = !topologyVisibility venueEngine.venueMap.selectedVenue?.isTopologyVisible = topologyVisibility + if(!topologyVisibility) { + venueTapHandler?.deselectTopology() + } if(topologyVisibility) { topPannelTopology.image = UIImage(named: "topology-focused") diff --git a/examples/latest/navigate/ios/Routing/Routing.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/Routing/Routing.xcodeproj/project.pbxproj index 90a60ca8..20291f4d 100644 --- a/examples/latest/navigate/ios/Routing/Routing.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/Routing/Routing.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ - C85F809221E5EDD800237ED0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85F809121E5EDD800237ED0 /* AppDelegate.swift */; }; - C85F809421E5EDD800237ED0 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85F809321E5EDD800237ED0 /* ViewController.swift */; }; - C85F809721E5EDD800237ED0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C85F809521E5EDD800237ED0 /* Main.storyboard */; }; - C85F809921E5EDD900237ED0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C85F809821E5EDD900237ED0 /* Assets.xcassets */; }; - C85F809C21E5EDD900237ED0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C85F809A21E5EDD900237ED0 /* LaunchScreen.storyboard */; }; - C85F80A421E5FC8000237ED0 /* RoutingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C85F80A321E5FC7F00237ED0 /* RoutingExample.swift */; }; - C88C015823CDF9FC00043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C015723CDF9FC00043918 /* heresdk.xcframework */; }; - C88C015923CDF9FC00043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C015723CDF9FC00043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 83C837BC2C207F340004F54E /* RoutingApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* RoutingApp.swift */; }; + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BD2C207F340004F54E /* ContentView.swift */; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* RoutingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* RoutingExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C88C015A23CDF9FC00043918 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C015923CDF9FC00043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,64 +31,68 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C85F808E21E5EDD800237ED0 /* Routing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Routing.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C85F809121E5EDD800237ED0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C85F809321E5EDD800237ED0 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C85F809621E5EDD800237ED0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C85F809821E5EDD900237ED0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C85F809B21E5EDD900237ED0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C85F809D21E5EDD900237ED0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C85F80A321E5FC7F00237ED0 /* RoutingExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoutingExample.swift; sourceTree = ""; }; - C88C015723CDF9FC00043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Routing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Routing.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* RoutingApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoutingApp.swift; sourceTree = ""; }; + 83C837BD2C207F340004F54E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 83C837BF2C207F360004F54E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 83C837C22C207F360004F54E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837D02C20EFA70004F54E /* RoutingExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoutingExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C85F808B21E5EDD800237ED0 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C015823CDF9FC00043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C85F808521E5EDD700237ED0 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C85F809021E5EDD800237ED0 /* Routing */, - C85F808F21E5EDD800237ED0 /* Products */, - C88C015623CDF9FC00043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* Routing */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C85F808F21E5EDD800237ED0 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C85F808E21E5EDD800237ED0 /* Routing.app */, + 83C837B82C207F340004F54E /* Routing.app */, ); name = Products; sourceTree = ""; }; - C85F809021E5EDD800237ED0 /* Routing */ = { + 83C837BA2C207F340004F54E /* Routing */ = { isa = PBXGroup; children = ( - C85F809121E5EDD800237ED0 /* AppDelegate.swift */, - C85F809321E5EDD800237ED0 /* ViewController.swift */, - C85F80A321E5FC7F00237ED0 /* RoutingExample.swift */, - C85F809521E5EDD800237ED0 /* Main.storyboard */, - C85F809821E5EDD900237ED0 /* Assets.xcassets */, - C85F809A21E5EDD900237ED0 /* LaunchScreen.storyboard */, - C85F809D21E5EDD900237ED0 /* Info.plist */, + 83C837BB2C207F340004F54E /* RoutingApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* RoutingExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = Routing; sourceTree = ""; }; - C88C015623CDF9FC00043918 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C88C015723CDF9FC00043918 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -97,14 +100,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C85F808D21E5EDD800237ED0 /* Routing */ = { + 83C837B72C207F340004F54E /* Routing */ = { isa = PBXNativeTarget; - buildConfigurationList = C85F80A021E5EDD900237ED0 /* Build configuration list for PBXNativeTarget "Routing" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Routing" */; buildPhases = ( - C85F808A21E5EDD800237ED0 /* Sources */, - C85F808B21E5EDD800237ED0 /* Frameworks */, - C85F808C21E5EDD800237ED0 /* Resources */, - C88C015A23CDF9FC00043918 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -112,98 +115,76 @@ ); name = Routing; productName = Routing; - productReference = C85F808E21E5EDD800237ED0 /* Routing.app */; + productReference = 83C837B82C207F340004F54E /* Routing.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C85F808621E5EDD700237ED0 /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1010; - LastUpgradeCheck = 1250; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C85F808D21E5EDD800237ED0 = { - CreatedOnToolsVersion = 10.1; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C85F808921E5EDD700237ED0 /* Build configuration list for PBXProject "Routing" */; - compatibilityVersion = "Xcode 3.2"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Routing" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C85F808521E5EDD700237ED0; - productRefGroup = C85F808F21E5EDD800237ED0 /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C85F808D21E5EDD800237ED0 /* Routing */, + 83C837B72C207F340004F54E /* Routing */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C85F808C21E5EDD800237ED0 /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C85F809C21E5EDD900237ED0 /* LaunchScreen.storyboard in Resources */, - C85F809921E5EDD900237ED0 /* Assets.xcassets in Resources */, - C85F809721E5EDD800237ED0 /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C85F808A21E5EDD800237ED0 /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C85F809421E5EDD800237ED0 /* ViewController.swift in Sources */, - C85F809221E5EDD800237ED0 /* AppDelegate.swift in Sources */, - C85F80A421E5FC8000237ED0 /* RoutingExample.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* RoutingApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* RoutingExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C85F809521E5EDD800237ED0 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C85F809621E5EDD800237ED0 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C85F809A21E5EDD900237ED0 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C85F809B21E5EDD900237ED0 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C85F809E21E5EDD900237ED0 /* Debug */ = { + 83C837C42C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -229,12 +210,12 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -248,24 +229,25 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - C85F809F21E5EDD900237ED0 /* Release */ = { + 83C837C52C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -291,12 +273,12 @@ CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -304,59 +286,71 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; - C85F80A121E5EDD900237ED0 /* Debug */ = { + 83C837C72C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Routing/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Routing/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - C85F80A221E5EDD900237ED0 /* Release */ = { + 83C837C82C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Routing/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Routing/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -365,25 +359,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C85F808921E5EDD700237ED0 /* Build configuration list for PBXProject "Routing" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Routing" */ = { isa = XCConfigurationList; buildConfigurations = ( - C85F809E21E5EDD900237ED0 /* Debug */, - C85F809F21E5EDD900237ED0 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C85F80A021E5EDD900237ED0 /* Build configuration list for PBXNativeTarget "Routing" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Routing" */ = { isa = XCConfigurationList; buildConfigurations = ( - C85F80A121E5EDD900237ED0 /* Debug */, - C85F80A221E5EDD900237ED0 /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C85F808621E5EDD700237ED0 /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/navigate/ios/Routing/Routing/AppDelegate.swift b/examples/latest/navigate/ios/Routing/Routing/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/Routing/Routing/AppDelegate.swift +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - - // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. - initializeHERESDK() - - return true - } - - private func initializeHERESDK() { - // Set your credentials for the HERE SDK. - let accessKeyID = "YOUR_ACCESS_KEY_ID" - let accessKeySecret = "YOUR_ACCESS_KEY_SECRET" - let options = SDKOptions(accessKeyId: accessKeyID, accessKeySecret: accessKeySecret) - do { - try SDKNativeEngine.makeSharedInstance(options: options) - } catch let engineInstantiationError { - fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") - } - } - - private func disposeHERESDK() { - // Free HERE SDK resources before the application shuts down. - // Usually, this should be called only on application termination. - // Afterwards, the HERE SDK is no longer usable unless it is initialized again. - SDKNativeEngine.sharedInstance = nil - } - - func applicationWillTerminate(_ application: UIApplication) { - disposeHERESDK() - } -} diff --git a/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,98 +1,13 @@ { "images" : [ { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/Routing/Routing/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/Routing/Routing/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/Routing/Routing/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/navigate/ios/Routing/Routing/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/Routing/Routing/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/Routing/Routing/Base.lproj/Main.storyboard deleted file mode 100644 index fa2f536a..00000000 --- a/examples/latest/navigate/ios/Routing/Routing/Base.lproj/Main.storyboard +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/Routing/Routing/ContentView.swift b/examples/latest/navigate/ios/Routing/Routing/ContentView.swift new file mode 100644 index 00000000..57c2a9db --- /dev/null +++ b/examples/latest/navigate/ios/Routing/Routing/ContentView.swift @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +struct ContentView: View { + + @State private var mapView = MapView() + @State private var routingExample: RoutingExample? + + var body: some View { + // Show the views on top of each other. + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + + VStack { + HStack { + CustomButton(title: "Add route") { + routingExample?.addRoute() + } + CustomButton(title: "Add waypoints") { + routingExample?.addWaypoints() + } + CustomButton(title: "Clear map") { + routingExample?.clearMap() + } + } + HStack { + CustomToggleButton(onLabel: "Traffic optimization: On", offLabel: "Traffic optimization: Off") { + routingExample?.toggleTrafficOptimization() + } + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + routingExample = RoutingExample(mapView) + } + } +} + +// The MapView provided by the HERE SDK conforms to a UIKit view, so it needs to be wrapped to conform +// to a SwiftUI view. The map view is created in the ContentView and bound here. +private struct WrappedMapView: UIViewRepresentable { + @Binding var mapView: MapView + func makeUIView(context: Context) -> MapView { return mapView } + func updateUIView(_ mapView: MapView, context: Context) { } +} + +// A reusable button to keep the layout clean. +struct CustomButton: View { + let title: String + let action: () -> Void + + var body: some View { + Button(action: action) { + Text(title) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +// A reusable toggle button to keep the layout clean. +struct CustomToggleButton: View { + @State private var isOn: Bool = false + var onLabel: String + var offLabel: String + var action: () -> Void + + var body: some View { + Button(action: { + isOn.toggle() + action() + }) { + Text(isOn ? onLabel : offLabel) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/examples/latest/navigate/ios/Routing/Routing/Info.plist b/examples/latest/navigate/ios/Routing/Routing/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/Routing/Routing/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/latest/navigate/ios/Routing/Routing/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Routing/Routing/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/Routing/Routing/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/Routing/Routing/RoutingApp.swift b/examples/latest/navigate/ios/Routing/Routing/RoutingApp.swift new file mode 100644 index 00000000..30ab2420 --- /dev/null +++ b/examples/latest/navigate/ios/Routing/Routing/RoutingApp.swift @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +// This class is the entry point to an application. +// HERE SDK initialization is done at start of app. When app is terminated, the HERE SDK is disposed. +@main +struct RoutingApp: App { + + var body: some Scene { + WindowGroup { + ContentView() + } + } + + init() { + observeAppLifecycle() + + // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. + initializeHERESDK() + } + + private func observeAppLifecycle() { + NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, + object: nil, + queue: nil) { _ in + // Perform cleanup or final tasks here. + print("App is about to terminate.") + disposeHERESDK() + } + } + + private func initializeHERESDK() { + // Set your credentials for the HERE SDK. + let accessKeyID = "YOUR_ACCESS_KEY_ID" + let accessKeySecret = "YOUR_ACCESS_KEY_SECRET" + let options = SDKOptions(accessKeyId: accessKeyID, accessKeySecret: accessKeySecret) + do { + try SDKNativeEngine.makeSharedInstance(options: options) + } catch let engineInstantiationError { + fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") + } + } + + private func disposeHERESDK() { + // Free HERE SDK resources before the application shuts down. + // Usually, this should be called only on application termination. + + // After this call, the HERE SDK is no longer usable unless it is initialized again. + SDKNativeEngine.sharedInstance = nil + } +} diff --git a/examples/latest/navigate/ios/Routing/Routing/RoutingExample.swift b/examples/latest/navigate/ios/Routing/Routing/RoutingExample.swift index ca7ace4d..8b281726 100644 --- a/examples/latest/navigate/ios/Routing/Routing/RoutingExample.swift +++ b/examples/latest/navigate/ios/Routing/Routing/RoutingExample.swift @@ -22,7 +22,6 @@ import UIKit class RoutingExample { - private var viewController: UIViewController private var mapView: MapView private var mapMarkers = [MapMarker]() private var mapPolylineList = [MapPolyline]() @@ -31,18 +30,31 @@ class RoutingExample { private var destinationGeoCoordinates: GeoCoordinates? private var disableOptimization = false - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView + + do { + try routingEngine = RoutingEngine() + } catch let engineInstantiationError { + fatalError("Failed to initialize routing engine. Cause: \(engineInstantiationError)") + } + + // Configure the map. let camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) camera.lookAt(point: GeoCoordinates(latitude: 52.520798, longitude: 13.409408), zoom: distanceInMeters) - do { - try routingEngine = RoutingEngine() - } catch let engineInstantiationError { - fatalError("Failed to initialize routing engine. Cause: \(engineInstantiationError)") + mapView.mapScene.enableFeatures([MapFeatures.lowSpeedZones : MapFeatureModes.lowSpeedZonesAll]); + + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) + } + + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") } } @@ -390,8 +402,19 @@ class RoutingExample { } private func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - viewController.present(alertController, animated: true, completion: nil) + if let topController = UIApplication.shared.windows.first?.rootViewController { + let alert = UIAlertController( + title: title, + message: message, + preferredStyle: .alert + ) + + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in + // Handle OK button action. + alert.dismiss(animated: true, completion: nil) + })) + + topController.present(alert, animated: true, completion: nil) + } } } diff --git a/examples/latest/navigate/ios/Routing/Routing/ViewController.swift b/examples/latest/navigate/ios/Routing/Routing/ViewController.swift deleted file mode 100644 index 023ebd69..00000000 --- a/examples/latest/navigate/ios/Routing/Routing/ViewController.swift +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -final class ViewController: UIViewController { - - @IBOutlet private var mapView: MapView! - @IBOutlet weak var button: UIButton! - private var disableTrafficOptimization = false - private var routingExample: RoutingExample! - private var isMapSceneLoaded = false - - override func viewDidLoad() { - super.viewDidLoad() - mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) - } - - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - mapView.mapScene.enableFeatures([MapFeatures.lowSpeedZones : MapFeatureModes.lowSpeedZonesAll]); - - // Start the example. - self.routingExample = RoutingExample(viewController: self, mapView: self.mapView!) - self.isMapSceneLoaded = true - } - - @IBAction func onAddRouteButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - routingExample.addRoute() - } - } - - @IBAction func onAddWaypointsButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - routingExample.addWaypoints() - } - } - - @IBAction func onClearMapButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - routingExample.clearMap() - } - } - - @IBAction func toggleTraffic(_ sender: UIButton) { - if disableTrafficOptimization { - sender.setTitle("Traffic Optimization-On", for: .normal) - } else { - sender.setTitle("Traffic Optimization-Off", for: .normal) - } - disableTrafficOptimization = !disableTrafficOptimization - routingExample.toggleTrafficOptimization() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/Search/Search.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/Search/Search.xcodeproj/project.pbxproj index 3a24ebb3..17f4e508 100644 --- a/examples/latest/navigate/ios/Search/Search.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/Search/Search.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ - C88C018223CDFD2000043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018123CDFD2000043918 /* heresdk.xcframework */; }; - C88C018323CDFD2000043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018123CDFD2000043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - C8D0BAE62163D074002FD93D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BAE52163D074002FD93D /* AppDelegate.swift */; }; - C8D0BAE82163D074002FD93D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BAE72163D074002FD93D /* ViewController.swift */; }; - C8D0BAEB2163D074002FD93D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BAE92163D074002FD93D /* Main.storyboard */; }; - C8D0BAED2163D076002FD93D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BAEC2163D076002FD93D /* Assets.xcassets */; }; - C8D0BAF02163D076002FD93D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BAEE2163D076002FD93D /* LaunchScreen.storyboard */; }; - C8D0BAF82163D2F6002FD93D /* SearchExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BAF72163D2F6002FD93D /* SearchExample.swift */; }; + 83C837BC2C207F340004F54E /* SearchApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* SearchApp.swift */; }; + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BD2C207F340004F54E /* ContentView.swift */; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* SearchExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* SearchExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C8288831224BD40B004903B8 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C018323CDFD2000043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,79 +31,83 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C88C018123CDFD2000043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; - C8D0BAE22163D074002FD93D /* Search.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Search.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C8D0BAE52163D074002FD93D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C8D0BAE72163D074002FD93D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C8D0BAEA2163D074002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C8D0BAEC2163D076002FD93D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C8D0BAEF2163D076002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C8D0BAF12163D076002FD93D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C8D0BAF72163D2F6002FD93D /* SearchExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchExample.swift; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Search.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Search.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* SearchApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchApp.swift; sourceTree = ""; }; + 83C837BD2C207F340004F54E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 83C837BF2C207F360004F54E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 83C837C22C207F360004F54E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837D02C20EFA70004F54E /* SearchExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C8D0BADF2163D074002FD93D /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C018223CDFD2000043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C88C018023CDFD2000043918 /* Frameworks */ = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C88C018123CDFD2000043918 /* heresdk.xcframework */, + 83C837BA2C207F340004F54E /* Search */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); - name = Frameworks; sourceTree = ""; }; - C8D0BAD92163D074002FD93D = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C8D0BAE42163D074002FD93D /* Search */, - C8D0BAE32163D074002FD93D /* Products */, - C88C018023CDFD2000043918 /* Frameworks */, + 83C837B82C207F340004F54E /* Search.app */, ); + name = Products; sourceTree = ""; }; - C8D0BAE32163D074002FD93D /* Products */ = { + 83C837BA2C207F340004F54E /* Search */ = { isa = PBXGroup; children = ( - C8D0BAE22163D074002FD93D /* Search.app */, + 83C837BB2C207F340004F54E /* SearchApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* SearchExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); - name = Products; + path = Search; sourceTree = ""; }; - C8D0BAE42163D074002FD93D /* Search */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C8D0BAE52163D074002FD93D /* AppDelegate.swift */, - C8D0BAE72163D074002FD93D /* ViewController.swift */, - C8D0BAF72163D2F6002FD93D /* SearchExample.swift */, - C8D0BAE92163D074002FD93D /* Main.storyboard */, - C8D0BAEC2163D076002FD93D /* Assets.xcassets */, - C8D0BAEE2163D076002FD93D /* LaunchScreen.storyboard */, - C8D0BAF12163D076002FD93D /* Info.plist */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, ); - path = Search; + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, + ); + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C8D0BAE12163D074002FD93D /* Search */ = { + 83C837B72C207F340004F54E /* Search */ = { isa = PBXNativeTarget; - buildConfigurationList = C8D0BAF42163D076002FD93D /* Build configuration list for PBXNativeTarget "Search" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Search" */; buildPhases = ( - C8D0BADE2163D074002FD93D /* Sources */, - C8D0BADF2163D074002FD93D /* Frameworks */, - C8D0BAE02163D074002FD93D /* Resources */, - C8288831224BD40B004903B8 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -112,98 +115,76 @@ ); name = Search; productName = Search; - productReference = C8D0BAE22163D074002FD93D /* Search.app */; + productReference = 83C837B82C207F340004F54E /* Search.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C8D0BADA2163D074002FD93D /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1000; - LastUpgradeCheck = 1000; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C8D0BAE12163D074002FD93D = { - CreatedOnToolsVersion = 10.0; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C8D0BADD2163D074002FD93D /* Build configuration list for PBXProject "Search" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Search" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C8D0BAD92163D074002FD93D; - productRefGroup = C8D0BAE32163D074002FD93D /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C8D0BAE12163D074002FD93D /* Search */, + 83C837B72C207F340004F54E /* Search */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C8D0BAE02163D074002FD93D /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BAF02163D076002FD93D /* LaunchScreen.storyboard in Resources */, - C8D0BAED2163D076002FD93D /* Assets.xcassets in Resources */, - C8D0BAEB2163D074002FD93D /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C8D0BADE2163D074002FD93D /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BAE82163D074002FD93D /* ViewController.swift in Sources */, - C8D0BAF82163D2F6002FD93D /* SearchExample.swift in Sources */, - C8D0BAE62163D074002FD93D /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* SearchApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* SearchExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C8D0BAE92163D074002FD93D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BAEA2163D074002FD93D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C8D0BAEE2163D076002FD93D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BAEF2163D076002FD93D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C8D0BAF22163D076002FD93D /* Debug */ = { + 83C837C42C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -222,18 +203,19 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -247,24 +229,25 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - C8D0BAF32163D076002FD93D /* Release */ = { + 83C837C52C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -283,18 +266,19 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -302,59 +286,71 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; - C8D0BAF52163D076002FD93D /* Debug */ = { + 83C837C72C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Search/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Search/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - C8D0BAF62163D076002FD93D /* Release */ = { + 83C837C82C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"Search/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Search/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -363,25 +359,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C8D0BADD2163D074002FD93D /* Build configuration list for PBXProject "Search" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Search" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BAF22163D076002FD93D /* Debug */, - C8D0BAF32163D076002FD93D /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C8D0BAF42163D076002FD93D /* Build configuration list for PBXNativeTarget "Search" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Search" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BAF52163D076002FD93D /* Debug */, - C8D0BAF62163D076002FD93D /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C8D0BADA2163D074002FD93D /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/navigate/ios/Search/Search/AppDelegate.swift b/examples/latest/navigate/ios/Search/Search/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/Search/Search/AppDelegate.swift +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - - // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. - initializeHERESDK() - - return true - } - - private func initializeHERESDK() { - // Set your credentials for the HERE SDK. - let accessKeyID = "YOUR_ACCESS_KEY_ID" - let accessKeySecret = "YOUR_ACCESS_KEY_SECRET" - let options = SDKOptions(accessKeyId: accessKeyID, accessKeySecret: accessKeySecret) - do { - try SDKNativeEngine.makeSharedInstance(options: options) - } catch let engineInstantiationError { - fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") - } - } - - private func disposeHERESDK() { - // Free HERE SDK resources before the application shuts down. - // Usually, this should be called only on application termination. - // Afterwards, the HERE SDK is no longer usable unless it is initialized again. - SDKNativeEngine.sharedInstance = nil - } - - func applicationWillTerminate(_ application: UIApplication) { - disposeHERESDK() - } -} diff --git a/examples/latest/navigate/ios/Search/Search/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/Search/Search/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/Search/Search/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/Search/Search/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/Search/Search/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/Search/Search/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/Search/Search/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,98 +1,13 @@ { "images" : [ { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/Search/Search/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Search/Search/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/Search/Search/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/Search/Search/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/Search/Search/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/Search/Search/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/navigate/ios/Search/Search/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/Search/Search/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/Search/Search/Base.lproj/Main.storyboard deleted file mode 100644 index d729e6e9..00000000 --- a/examples/latest/navigate/ios/Search/Search/Base.lproj/Main.storyboard +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/Search/Search/ContentView.swift b/examples/latest/navigate/ios/Search/Search/ContentView.swift new file mode 100644 index 00000000..c61f2b63 --- /dev/null +++ b/examples/latest/navigate/ios/Search/Search/ContentView.swift @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +struct ContentView: View { + + @State private var mapView = MapView() + @State private var searchExample: SearchExample? + + var body: some View { + // Show the views on top of each other. + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + + HStack { + CustomButton(title: "Search example") { + searchExample?.onSearchButtonClicked() + } + CustomButton(title: "GeoCode example") { + searchExample?.onGeoCodeButtonClicked() + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + searchExample = SearchExample(mapView) + } + } +} + +// The MapView provided by the HERE SDK conforms to a UIKit view, so it needs to be wrapped to conform +// to a SwiftUI view. The map view is created in the ContentView and bound here. +private struct WrappedMapView: UIViewRepresentable { + @Binding var mapView: MapView + func makeUIView(context: Context) -> MapView { return mapView } + func updateUIView(_ mapView: MapView, context: Context) { } +} + +// A reusable button to keep the layout clean. +struct CustomButton: View { + let title: String + let action: () -> Void + + var body: some View { + Button(action: action) { + Text(title) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/examples/latest/navigate/ios/Search/Search/Info.plist b/examples/latest/navigate/ios/Search/Search/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/Search/Search/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/latest/navigate/ios/Search/Search/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Search/Search/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/Search/Search/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/Search/Search/AppDelegate.swift b/examples/latest/navigate/ios/Search/Search/SearchApp.swift similarity index 63% rename from examples/latest/explore/ios/Search/Search/AppDelegate.swift rename to examples/latest/navigate/ios/Search/Search/SearchApp.swift index 5c8c8eef..89117573 100644 --- a/examples/latest/explore/ios/Search/Search/AppDelegate.swift +++ b/examples/latest/navigate/ios/Search/Search/SearchApp.swift @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 HERE Europe B.V. + * Copyright (C) 2022-2024 HERE Europe B.V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,20 +18,34 @@ */ import heresdk -import UIKit +import SwiftUI -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. +// This class is the entry point to an application. +// HERE SDK initialization is done at start of app. When app is terminated, the HERE SDK is disposed. +@main +struct SearchApp: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } + + init() { + observeAppLifecycle() + // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. initializeHERESDK() - - return true + } + + private func observeAppLifecycle() { + NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, + object: nil, + queue: nil) { _ in + // Perform cleanup or final tasks here. + print("App is about to terminate.") + disposeHERESDK() + } } private func initializeHERESDK() { @@ -45,15 +59,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") } } - + private func disposeHERESDK() { // Free HERE SDK resources before the application shuts down. // Usually, this should be called only on application termination. - // Afterwards, the HERE SDK is no longer usable unless it is initialized again. + + // After this call, the HERE SDK is no longer usable unless it is initialized again. SDKNativeEngine.sharedInstance = nil } - - func applicationWillTerminate(_ application: UIApplication) { - disposeHERESDK() - } } diff --git a/examples/latest/navigate/ios/Search/Search/SearchExample.swift b/examples/latest/navigate/ios/Search/Search/SearchExample.swift index 654d569a..4731b792 100644 --- a/examples/latest/navigate/ios/Search/Search/SearchExample.swift +++ b/examples/latest/navigate/ios/Search/Search/SearchExample.swift @@ -23,14 +23,14 @@ import UIKit class SearchExample: TapDelegate, LongPressDelegate { - private var viewController: UIViewController private var mapView: MapView private var mapMarkers = [MapMarker]() private var searchEngine: SearchEngine - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView + + // Configure the map. let camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) camera.lookAt(point: GeoCoordinates(latitude: 52.520798, longitude: 13.409408), @@ -45,9 +45,19 @@ class SearchExample: TapDelegate, mapView.gestures.tapDelegate = self mapView.gestures.longPressDelegate = self + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) + showDialog(title: "Note", message: "Long press on map to get the address for that position using reverse geocoding.") } + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } + func onSearchButtonClicked() { // Search for "Pizza" and show the results on the map. searchExample() @@ -313,13 +323,7 @@ class SearchExample: TapDelegate, // Note: This algorithm assumes an unrotated map view. return GeoBox(southWestCorner: southWestCorner, northEastCorner: northEastCorner) } - - private func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - viewController.present(alertController, animated: true, completion: nil) - } - + private func clearMap() { for mapMarker in mapMarkers { mapView.mapScene.removeMapMarker(mapMarker) @@ -327,4 +331,21 @@ class SearchExample: TapDelegate, mapMarkers.removeAll() } + + private func showDialog(title: String, message: String) { + if let topController = UIApplication.shared.windows.first?.rootViewController { + let alert = UIAlertController( + title: title, + message: message, + preferredStyle: .alert + ) + + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in + // Handle OK button action. + alert.dismiss(animated: true, completion: nil) + })) + + topController.present(alert, animated: true, completion: nil) + } + } } diff --git a/examples/latest/navigate/ios/Search/Search/ViewController.swift b/examples/latest/navigate/ios/Search/Search/ViewController.swift deleted file mode 100644 index b10f0a9c..00000000 --- a/examples/latest/navigate/ios/Search/Search/ViewController.swift +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -final class ViewController: UIViewController { - - @IBOutlet private var mapView: MapView! - private var searchExample: SearchExample! - private var isMapSceneLoaded = false - - override func viewDidLoad() { - super.viewDidLoad() - - // Load the map scene using a map style to render the map with. - mapView.mapScene.loadScene(mapScheme: .normalDay, completion: onLoadScene) - } - - func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - // Start the example. - searchExample = SearchExample(viewController: self, mapView: mapView!) - isMapSceneLoaded = true - } - - @IBAction func onSearchButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - searchExample.onSearchButtonClicked() - } - } - - @IBAction func onGeoCodeButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - searchExample.onGeoCodeButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid.xcodeproj/project.pbxproj index 4e92b19d..ffda2853 100644 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 56; objects = { /* Begin PBXBuildFile section */ - C88C018223CDFD2000043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018123CDFD2000043918 /* heresdk.xcframework */; }; - C88C018323CDFD2000043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018123CDFD2000043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - C8D0BAE62163D074002FD93D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BAE52163D074002FD93D /* AppDelegate.swift */; }; - C8D0BAE82163D074002FD93D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BAE72163D074002FD93D /* ViewController.swift */; }; - C8D0BAEB2163D074002FD93D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BAE92163D074002FD93D /* Main.storyboard */; }; - C8D0BAED2163D076002FD93D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BAEC2163D076002FD93D /* Assets.xcassets */; }; - C8D0BAF02163D076002FD93D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BAEE2163D076002FD93D /* LaunchScreen.storyboard */; }; - C8D0BAF82163D2F6002FD93D /* SearchExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BAF72163D2F6002FD93D /* SearchExample.swift */; }; + 83C837BC2C207F340004F54E /* SearchHybridApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* SearchHybridApp.swift */; }; + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BD2C207F340004F54E /* ContentView.swift */; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* SearchHybridExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* SearchHybridExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C8288831224BD40B004903B8 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C018323CDFD2000043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,79 +31,83 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C88C018123CDFD2000043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; - C8D0BAE22163D074002FD93D /* SearchHybrid.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SearchHybrid.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C8D0BAE52163D074002FD93D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C8D0BAE72163D074002FD93D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C8D0BAEA2163D074002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C8D0BAEC2163D076002FD93D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C8D0BAEF2163D076002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C8D0BAF12163D076002FD93D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C8D0BAF72163D2F6002FD93D /* SearchExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchExample.swift; sourceTree = ""; }; + 83C837B82C207F340004F54E /* SearchHybrid.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SearchHybrid.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* SearchHybridApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchHybridApp.swift; sourceTree = ""; }; + 83C837BD2C207F340004F54E /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 83C837BF2C207F360004F54E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 83C837C22C207F360004F54E /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837D02C20EFA70004F54E /* SearchHybridExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchHybridExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C8D0BADF2163D074002FD93D /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C018223CDFD2000043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C88C018023CDFD2000043918 /* Frameworks */ = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C88C018123CDFD2000043918 /* heresdk.xcframework */, + 83C837BA2C207F340004F54E /* SearchHybrid */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); - name = Frameworks; sourceTree = ""; }; - C8D0BAD92163D074002FD93D = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C8D0BAE42163D074002FD93D /* SearchHybrid */, - C8D0BAE32163D074002FD93D /* Products */, - C88C018023CDFD2000043918 /* Frameworks */, + 83C837B82C207F340004F54E /* SearchHybrid.app */, ); + name = Products; sourceTree = ""; }; - C8D0BAE32163D074002FD93D /* Products */ = { + 83C837BA2C207F340004F54E /* SearchHybrid */ = { isa = PBXGroup; children = ( - C8D0BAE22163D074002FD93D /* SearchHybrid.app */, + 83C837BB2C207F340004F54E /* SearchHybridApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* SearchHybridExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); - name = Products; + path = SearchHybrid; sourceTree = ""; }; - C8D0BAE42163D074002FD93D /* SearchHybrid */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C8D0BAE52163D074002FD93D /* AppDelegate.swift */, - C8D0BAE72163D074002FD93D /* ViewController.swift */, - C8D0BAF72163D2F6002FD93D /* SearchExample.swift */, - C8D0BAE92163D074002FD93D /* Main.storyboard */, - C8D0BAEC2163D076002FD93D /* Assets.xcassets */, - C8D0BAEE2163D076002FD93D /* LaunchScreen.storyboard */, - C8D0BAF12163D076002FD93D /* Info.plist */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, ); - path = SearchHybrid; + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, + ); + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C8D0BAE12163D074002FD93D /* SearchHybrid */ = { + 83C837B72C207F340004F54E /* SearchHybrid */ = { isa = PBXNativeTarget; - buildConfigurationList = C8D0BAF42163D076002FD93D /* Build configuration list for PBXNativeTarget "SearchHybrid" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "SearchHybrid" */; buildPhases = ( - C8D0BADE2163D074002FD93D /* Sources */, - C8D0BADF2163D074002FD93D /* Frameworks */, - C8D0BAE02163D074002FD93D /* Resources */, - C8288831224BD40B004903B8 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -112,98 +115,76 @@ ); name = SearchHybrid; productName = SearchHybrid; - productReference = C8D0BAE22163D074002FD93D /* SearchHybrid.app */; + productReference = 83C837B82C207F340004F54E /* SearchHybrid.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C8D0BADA2163D074002FD93D /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1000; - LastUpgradeCheck = 1000; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C8D0BAE12163D074002FD93D = { - CreatedOnToolsVersion = 10.0; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C8D0BADD2163D074002FD93D /* Build configuration list for PBXProject "SearchHybrid" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "SearchHybrid" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C8D0BAD92163D074002FD93D; - productRefGroup = C8D0BAE32163D074002FD93D /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C8D0BAE12163D074002FD93D /* SearchHybrid */, + 83C837B72C207F340004F54E /* SearchHybrid */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C8D0BAE02163D074002FD93D /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BAF02163D076002FD93D /* LaunchScreen.storyboard in Resources */, - C8D0BAED2163D076002FD93D /* Assets.xcassets in Resources */, - C8D0BAEB2163D074002FD93D /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C8D0BADE2163D074002FD93D /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BAE82163D074002FD93D /* ViewController.swift in Sources */, - C8D0BAF82163D2F6002FD93D /* SearchExample.swift in Sources */, - C8D0BAE62163D074002FD93D /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* SearchHybridApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* SearchHybridExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C8D0BAE92163D074002FD93D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BAEA2163D074002FD93D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C8D0BAEE2163D076002FD93D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BAEF2163D076002FD93D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C8D0BAF22163D076002FD93D /* Debug */ = { + 83C837C42C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -222,18 +203,19 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -247,24 +229,25 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; }; name = Debug; }; - C8D0BAF32163D076002FD93D /* Release */ = { + 83C837C52C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -283,18 +266,19 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -302,59 +286,71 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; VALIDATE_PRODUCT = YES; }; name = Release; }; - C8D0BAF52163D076002FD93D /* Debug */ = { + 83C837C72C207F360004F54E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"SearchHybrid/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = SearchHybrid/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; - C8D0BAF62163D076002FD93D /* Release */ = { + 83C837C82C207F360004F54E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"SearchHybrid/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = SearchHybrid/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 13.0; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; + INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 14.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -363,25 +359,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C8D0BADD2163D074002FD93D /* Build configuration list for PBXProject "SearchHybrid" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "SearchHybrid" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BAF22163D076002FD93D /* Debug */, - C8D0BAF32163D076002FD93D /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C8D0BAF42163D076002FD93D /* Build configuration list for PBXNativeTarget "SearchHybrid" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "SearchHybrid" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BAF52163D076002FD93D /* Debug */, - C8D0BAF62163D076002FD93D /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C8D0BADA2163D074002FD93D /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/AppDelegate.swift b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/AppDelegate.swift +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -@UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate { - - var window: UIWindow? - - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. - - // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. - initializeHERESDK() - - return true - } - - private func initializeHERESDK() { - // Set your credentials for the HERE SDK. - let accessKeyID = "YOUR_ACCESS_KEY_ID" - let accessKeySecret = "YOUR_ACCESS_KEY_SECRET" - let options = SDKOptions(accessKeyId: accessKeyID, accessKeySecret: accessKeySecret) - do { - try SDKNativeEngine.makeSharedInstance(options: options) - } catch let engineInstantiationError { - fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") - } - } - - private func disposeHERESDK() { - // Free HERE SDK resources before the application shuts down. - // Usually, this should be called only on application termination. - // Afterwards, the HERE SDK is no longer usable unless it is initialized again. - SDKNativeEngine.sharedInstance = nil - } - - func applicationWillTerminate(_ application: UIApplication) { - disposeHERESDK() - } -} diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,98 +1,13 @@ { "images" : [ { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "20x20", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "29x29", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "40x40", - "scale" : "3x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "2x" - }, - { - "idiom" : "iphone", - "size" : "60x60", - "scale" : "3x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "20x20", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "29x29", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "40x40", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "1x" - }, - { - "idiom" : "ipad", - "size" : "76x76", - "scale" : "2x" - }, - { - "idiom" : "ipad", - "size" : "83.5x83.5", - "scale" : "2x" - }, - { - "idiom" : "ios-marketing", - "size" : "1024x1024", - "scale" : "1x" + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Assets.xcassets/Contents.json @@ -1,6 +1,6 @@ { "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Base.lproj/Main.storyboard deleted file mode 100644 index d4859603..00000000 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Base.lproj/Main.storyboard +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/ContentView.swift b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/ContentView.swift new file mode 100644 index 00000000..3969ba77 --- /dev/null +++ b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/ContentView.swift @@ -0,0 +1,108 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +struct ContentView: View { + + @State private var mapView = MapView() + @State private var searchHybridExample: SearchHybridExample? + + var body: some View { + // Show the views on top of each other. + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + + VStack { + HStack { + CustomButton(title: "Search example") { + searchHybridExample?.onSearchButtonClicked() + } + CustomButton(title: "Geocoding example") { + searchHybridExample?.onGeoCodeButtonClicked() + } + } + HStack { + CustomToggleButton(onLabel: "Online: On", offLabel: "Online: Off") { + searchHybridExample?.onToggleOnlineButton() + } + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + searchHybridExample = SearchHybridExample(mapView) + } + } +} + +// The MapView provided by the HERE SDK conforms to a UIKit view, so it needs to be wrapped to conform +// to a SwiftUI view. The map view is created in the ContentView and bound here. +private struct WrappedMapView: UIViewRepresentable { + @Binding var mapView: MapView + func makeUIView(context: Context) -> MapView { return mapView } + func updateUIView(_ mapView: MapView, context: Context) { } +} + +// A reusable button to keep the layout clean. +struct CustomButton: View { + let title: String + let action: () -> Void + + var body: some View { + Button(action: action) { + Text(title) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +// A reusable toggle button to keep the layout clean. +struct CustomToggleButton: View { + @State private var isOn: Bool = true + var onLabel: String + var offLabel: String + var action: () -> Void + + var body: some View { + Button(action: { + isOn.toggle() + action() + }) { + Text(isOn ? onLabel : offLabel) + .padding() + .background(Color(red: 0, green: 182/255, blue: 178/255)) + .foregroundColor(.white) + .cornerRadius(5) + } + } +} + +struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + } +} diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Info.plist b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Info.plist +++ /dev/null @@ -1,41 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - - diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridApp.swift b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridApp.swift new file mode 100644 index 00000000..451ebb66 --- /dev/null +++ b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridApp.swift @@ -0,0 +1,70 @@ +/* + * Copyright (C) 2022-2024 HERE Europe B.V. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + * License-Filename: LICENSE + */ + +import heresdk +import SwiftUI + +// This class is the entry point to an application. +// HERE SDK initialization is done at start of app. When app is terminated, the HERE SDK is disposed. +@main +struct SearchHybridApp: App { + + var body: some Scene { + WindowGroup { + ContentView() + } + } + + init() { + observeAppLifecycle() + + // Usually, you need to initialize the HERE SDK only once during the lifetime of an application. + initializeHERESDK() + } + + private func observeAppLifecycle() { + NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification, + object: nil, + queue: nil) { _ in + // Perform cleanup or final tasks here. + print("App is about to terminate.") + disposeHERESDK() + } + } + + private func initializeHERESDK() { + // Set your credentials for the HERE SDK. + let accessKeyID = "YOUR_ACCESS_KEY_ID" + let accessKeySecret = "YOUR_ACCESS_KEY_SECRET" + let options = SDKOptions(accessKeyId: accessKeyID, accessKeySecret: accessKeySecret) + do { + try SDKNativeEngine.makeSharedInstance(options: options) + } catch let engineInstantiationError { + fatalError("Failed to initialize the HERE SDK. Cause: \(engineInstantiationError)") + } + } + + private func disposeHERESDK() { + // Free HERE SDK resources before the application shuts down. + // Usually, this should be called only on application termination. + + // After this call, the HERE SDK is no longer usable unless it is initialized again. + SDKNativeEngine.sharedInstance = nil + } +} diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchExample.swift b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridExample.swift similarity index 91% rename from examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchExample.swift rename to examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridExample.swift index c020521b..0b8b235e 100644 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchExample.swift +++ b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridExample.swift @@ -20,22 +20,22 @@ import heresdk import UIKit -class SearchExample: TapDelegate, +class SearchHybridExample: TapDelegate, LongPressDelegate { - private var viewController: UIViewController private var mapView: MapView private var mapMarkers = [MapMarker]() private var searchEngine: SearchEngine private var offlineSearchEngine: OfflineSearchEngine - + // An application may define a logic to determine whether a device is connected or not. // For this example app, the flag is set from UI. private var isDeviceConnected = true - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView + + // Configure the map. let camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: 5000) camera.lookAt(point: GeoCoordinates(latitude: 52.520798, longitude: 13.409408), @@ -57,9 +57,19 @@ class SearchExample: TapDelegate, mapView.gestures.tapDelegate = self mapView.gestures.longPressDelegate = self + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) + showDialog(title: "Note", message: "Long press on map to get the address for that position using reverse geocoding.") } + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } + func onSearchButtonClicked() { // Search for "Pizza" and show the results on the map. searchExample() @@ -73,16 +83,16 @@ class SearchExample: TapDelegate, geocodeAnAddress() } - func onSwitchOnlineButtonClicked() { - isDeviceConnected = true - showDialog(title: "Note", message: "The app uses now the SearchEngine.") - } - - func onSwitchOfflineButtonClicked() { - isDeviceConnected = false - showDialog(title: "Note", message: "The app uses now the OfflineSearchEngine.") + func onToggleOnlineButton() { + isDeviceConnected = !isDeviceConnected + + if isDeviceConnected { + showDialog(title: "Note", message: "The app uses now the SearchEngine.") + } else { + showDialog(title: "Note", message: "The app uses now the OfflineSearchEngine.") + } } - + private func searchExample() { let searchTerm = "Pizza" searchInViewport(queryString: searchTerm) @@ -114,6 +124,9 @@ class SearchExample: TapDelegate, // search results may not be available for all zoom levels. // Please also note that it may take time until the required map data is loaded. // Subsequently, the cache is filled when a user pans and zooms the map. + // + // For best results, it is recommended to permanently install offline region data and use the + // OfflineSearchEngine for areas where region data has been installed. showDialog(title: "Search", message: "Error: \(searchError)") return } @@ -150,7 +163,7 @@ class SearchExample: TapDelegate, maxItems: 5) let queryArea = TextQuery.Area(areaCenter: centerGeoCoordinates) - + if isDeviceConnected { // Simulate a user typing a search term. _ = searchEngine.suggest(textQuery: TextQuery("p", area: queryArea), @@ -208,7 +221,7 @@ class SearchExample: TapDelegate, let streetName = "Invalidenstraße 116, Berlin" geocodeAddressAtLocation(queryString: streetName, geoCoordinates: geoCoordinates) } - + private func geocodeAddressAtLocation(queryString: String, geoCoordinates: GeoCoordinates) { clearMap() @@ -258,7 +271,7 @@ class SearchExample: TapDelegate, // Creates a list of map content type from which the results will be picked. // The content type values can be mapContent, mapItems and customLayerData. var contentTypesToPickFrom = Array(); - + // mapContent is used when picking embedded carto POIs, traffic incidents, vehicle restriction etc. // mapItems is used when picking map items such as MapMarker, MapPolyline, MapPolygon etc. // Currently we need map markers so adding the mapItems filter. @@ -384,8 +397,19 @@ class SearchExample: TapDelegate, } private func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil)) - viewController.present(alertController, animated: true, completion: nil) + if let topController = UIApplication.shared.windows.first?.rootViewController { + let alert = UIAlertController( + title: title, + message: message, + preferredStyle: .alert + ) + + alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in + // Handle OK button action. + alert.dismiss(animated: true, completion: nil) + })) + + topController.present(alert, animated: true, completion: nil) + } } } diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/ViewController.swift b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/ViewController.swift deleted file mode 100644 index baf4dae9..00000000 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/ViewController.swift +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2019-2024 HERE Europe B.V. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * SPDX-License-Identifier: Apache-2.0 - * License-Filename: LICENSE - */ - -import heresdk -import UIKit - -final class ViewController: UIViewController { - - @IBOutlet private var mapView: MapView! - private var searchExample: SearchExample! - private var isMapSceneLoaded = false - - override func viewDidLoad() { - super.viewDidLoad() - - // Load the map scene using a map style to render the map with. - mapView.mapScene.loadScene(mapScheme: .normalDay, completion: onLoadScene) - } - - func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - // Start the example. - searchExample = SearchExample(viewController: self, mapView: mapView!) - isMapSceneLoaded = true - } - - @IBAction func onSearchButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - searchExample.onSearchButtonClicked() - } - } - - @IBAction func onGeoCodeButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - searchExample.onGeoCodeButtonClicked() - } - } - - @IBAction func onSwitchOnlineClicked(_ sender: Any) { - if isMapSceneLoaded { - searchExample.onSwitchOnlineButtonClicked() - } - } - - @IBAction func onSwitchOfflineClicked(_ sender: Any) { - if isMapSceneLoaded { - searchExample.onSwitchOfflineButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/AVAudioPlayerNodeManager.swift b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/AVAudioPlayerNodeManager.swift index c1d78684..cbced00a 100644 --- a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/AVAudioPlayerNodeManager.swift +++ b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/AVAudioPlayerNodeManager.swift @@ -34,8 +34,9 @@ public final class AVAudioPlayerNodeManager: NSObject{ private let monoOutputFormat : AVAudioFormat private var locale = Locale(identifier: "en-US") private var bufferList = [AVAudioPCMBuffer]() - private var audioCuePanning: SpatialManeuverAudioCuePanning? + private var audioCuePanning: SpatialAudioCuePanning? private let preferredAudioFormat: AVAudioCommonFormat + private var azimuthCallback : SpatialAudioCuePanning.onSpatialAzimuthStarterHandler? fileprivate let cd = AudioComponentDescription( componentType: kAudioUnitType_Effect, @@ -97,13 +98,16 @@ public final class AVAudioPlayerNodeManager: NSObject{ self.locale = locale } + /// Set all the requirements for spatialising the audio cue /// /// - Parameter audioCue: String containing the audio cue to be spatialised /// - Parameter audioCuePanning: Object which starts the angular panning notifications - public func prepareSpatialAudioCue(audioCue: String, audioCuePanning: SpatialManeuverAudioCuePanning) { + /// - Parameter azimuthCallback: Calllback for azimuth notifications + public func prepareSpatialAudioCue(audioCue: String, audioCuePanning: SpatialAudioCuePanning, azimuthCallback : @escaping SpatialAudioCuePanning.onSpatialAzimuthStarterHandler) { self.audioCuePanning = audioCuePanning - + self.azimuthCallback = azimuthCallback + // Set voice message let utterance = AVSpeechUtterance(string: audioCue) utterance.pitchMultiplier = speechPitch @@ -187,14 +191,20 @@ public final class AVAudioPlayerNodeManager: NSObject{ func startAudioEngineAndPlay(bufferLengthInMs: Double) { // Start audio engine do { - try engine.start() - play() - startAngularPanning(bufferLengthInMs: bufferLengthInMs) + try engine.start() + play() + startAngularPanning() } catch let error { AudioSessionManager.shared.setAudioSessionState(activated: false) print("An error has occurred while starting the engine. \(error.localizedDescription)") } } + + func startAngularPanning(){ + var customPanningData = CustomPanningData() + customPanningData.estimatedAudioCueDuration = 2.62 + audioCuePanning?.startAngularPanning(nextCustomPanningData: customPanningData, azimuthCallback: azimuthCallback!) + } func getBufferLengthInMs(buffer: AVAudioPCMBuffer) -> TimeInterval { let framecount = Double(buffer.frameLength) @@ -202,13 +212,6 @@ public final class AVAudioPlayerNodeManager: NSObject{ return TimeInterval(framecount / samplerate) } - func startAngularPanning(bufferLengthInMs: Double) { - var nextCustomPanningData = CustomPanningData() - var test: Double = 2.62 - nextCustomPanningData.estimatedAudioCueDuration = test - print("Next buffer length \(bufferLengthInMs)") - audioCuePanning?.startPanning(nextCustomPanningData: nextCustomPanningData) - } } extension AVAudioPlayerNodeManager: AVSpeechSynthesizerDelegate { diff --git a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/DefaultEncoder.swift b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/DefaultEncoder.swift index 6bc46f26..579d0802 100644 --- a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/DefaultEncoder.swift +++ b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/DefaultEncoder.swift @@ -30,13 +30,13 @@ class DefaultEncoder: EncoderInterface { avAudioPlayerNodeManager?.stopPlaying() } - func playAudioCue(audioCue: String, initialAzimuthInDegrees: Float, audioCuePanning: SpatialManeuverAudioCuePanning) { + func playAudioCue(audioCue: String, initialAzimuthInDegrees: Float, audioCuePanning: SpatialAudioCuePanning, azimuthCallback : @escaping SpatialAudioCuePanning.onSpatialAzimuthStarterHandler) { // Stops the previous audio cue if is still being played when a new one has been triggered avAudioPlayerNodeManager?.resetAudio() avAudioPlayerNodeManager?.configureAudio() // It is recommended to set the initial azimuth right after stopping the previous one (if still playing) and playing the current one to ensure that is played from the correct side at the beginning of the audio cue. setCurrentAzimuthDegrees(nextAzimuthInDegrees: initialAzimuthInDegrees) - avAudioPlayerNodeManager?.prepareSpatialAudioCue(audioCue: audioCue, audioCuePanning: audioCuePanning) + avAudioPlayerNodeManager?.prepareSpatialAudioCue(audioCue: audioCue, audioCuePanning: audioCuePanning, azimuthCallback: azimuthCallback) } // Basic encoder diff --git a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/EncoderInterface.swift b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/EncoderInterface.swift index 2ee8a3d9..18b38b3a 100644 --- a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/EncoderInterface.swift +++ b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/EncoderInterface.swift @@ -22,7 +22,7 @@ import heresdk protocol EncoderInterface { func stopPlayingAudioCue() - func playAudioCue(audioCue: String, initialAzimuthInDegrees: Float, audioCuePanning: SpatialManeuverAudioCuePanning) + func playAudioCue(audioCue: String, initialAzimuthInDegrees: Float, audioCuePanning: SpatialAudioCuePanning, azimuthCallback : @escaping SpatialAudioCuePanning.onSpatialAzimuthStarterHandler) func setCurrentAzimuthDegrees(nextAzimuthInDegrees: Float) func isEncoderPlaying() -> Bool func setLocaleLanguage(locale: Locale) diff --git a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/SpatialAudioExample.swift b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/SpatialAudioExample.swift index 830f6a04..6a9708c3 100644 --- a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/SpatialAudioExample.swift +++ b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/SpatialAudioExample.swift @@ -40,8 +40,8 @@ class SpatialAudioExample { return navigating } - public func playSpatialAudioCue(audioCue: String, initialAzimuthInDegrees: Float, audioCuePanning: SpatialManeuverAudioCuePanning){ - encoder!.playAudioCue(audioCue: audioCue, initialAzimuthInDegrees: initialAzimuthInDegrees, audioCuePanning: audioCuePanning) + public func playSpatialAudioCue(audioCue: String, initialAzimuthInDegrees: Float, audioCuePanning: SpatialAudioCuePanning, azimuthCallback : @escaping SpatialAudioCuePanning.onSpatialAzimuthStarterHandler){ + encoder!.playAudioCue(audioCue: audioCue, initialAzimuthInDegrees: initialAzimuthInDegrees, audioCuePanning: audioCuePanning,azimuthCallback: azimuthCallback) } public func updatePanning(azimuthInDegrees: Float) { diff --git a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/SpatialNavigationExample.swift b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/SpatialNavigationExample.swift index 3539e4a8..4f8495b7 100644 --- a/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/SpatialNavigationExample.swift +++ b/examples/latest/navigate/ios/SpatialAudioNavigation/SpatialAudioNavigation/SpatialNavigationExample.swift @@ -21,7 +21,7 @@ import heresdk import Foundation import UIKit -class SpatialNavigationExample: SpatialManeuverNotificationDelegate, SpatialManeuverAzimuthDelegate { +class SpatialNavigationExample: EventTextDelegate { private var spatialAudioExample: SpatialAudioExample? private var visualNavigator: VisualNavigator? private var locationSimulator: LocationSimulator? @@ -64,8 +64,13 @@ class SpatialNavigationExample: SpatialManeuverNotificationDelegate, SpatialMane } } - func onSpatialManeuverNotification(spatialManeuver: SpatialManeuver, audioCuePanning: SpatialManeuverAudioCuePanning) { - spatialAudioExample?.playSpatialAudioCue(audioCue: spatialManeuver.voiceText, initialAzimuthInDegrees: Float(spatialManeuver.initialAzimuthInDegrees), audioCuePanning: audioCuePanning) + func onEventTextUpdated(_ eventText: heresdk.EventText) { + let azimuthCallback : SpatialAudioCuePanning.onSpatialAzimuthStarterHandler = { str in + self.onAzimuthNotification(nextSpatialTrajectoryData: str) + } + if (eventText.spatialNotificationDetails != nil ) { + spatialAudioExample?.playSpatialAudioCue(audioCue: eventText.text, initialAzimuthInDegrees:Float(eventText.spatialNotificationDetails!.initialAzimuthInDegrees), audioCuePanning: eventText.spatialNotificationDetails!.audioCuePanning,azimuthCallback: azimuthCallback) + } } func onAzimuthNotification(nextSpatialTrajectoryData: SpatialTrajectoryData) { @@ -90,15 +95,17 @@ class SpatialNavigationExample: SpatialManeuverNotificationDelegate, SpatialMane spatialAudioExample?.setupVoiceGuidance(visualNavigator: visualNavigator!) + // Event text options can be used for enabling the trigger for spatial audio details. + let eventTextOptions = EventTextOptions(enableSpatialAudio: true) + + visualNavigator!.eventTextOptions = eventTextOptions + // This enables a navigation view including a rendered navigation arrow. visualNavigator!.startRendering(mapView: mapView!) // Hook in one of the many listeners. Here we set up a listener to get instructions on the spatial maneuvers to take while driving. // For more details, please check the "Navigation" example app and the Developer's Guide. - visualNavigator!.spatialManeuverNotificationDelegate = self - - // Here we set up a listener to get the next azimuth to be apply in order to follow the spatial audio trajectory - visualNavigator!.spatialManeuverAzimuthDelegate = self + visualNavigator!.eventTextDelegate = self // Set a route to follow. This leaves tracking mode. visualNavigator!.route = route diff --git a/examples/latest/navigate/ios/TruckGuidance/TruckGuidance/TruckGuidanceExample.swift b/examples/latest/navigate/ios/TruckGuidance/TruckGuidance/TruckGuidanceExample.swift index 59ec084e..411393f1 100644 --- a/examples/latest/navigate/ios/TruckGuidance/TruckGuidance/TruckGuidanceExample.swift +++ b/examples/latest/navigate/ios/TruckGuidance/TruckGuidance/TruckGuidanceExample.swift @@ -197,7 +197,7 @@ class TruckGuidanceExample: TapDelegate, // Creates a list of map content type from which the results will be picked. // The content type values can be mapContent, mapItems and customLayerData. var contentTypesToPickFrom = Array(); - + // mapContent is used when picking embedded carto POIs, traffic incidents, vehicle restriction etc. // mapItems is used when picking map items such as MapMarker, MapPolyline, MapPolygon etc. // Currently we need map contents so adding the mapContent filter. @@ -225,7 +225,7 @@ class TruckGuidanceExample: TapDelegate, print("searchPickedPlace() resulted in an error: \(searchError)") return } - + if let place = place { let address = place.address.addressText var categories = "" @@ -243,7 +243,7 @@ class TruckGuidanceExample: TapDelegate, self.showDialog(title: "Traffic incident picked", message: "Type: \(topmostContent.type.rawValue)") // Optionally, you can now use the TrafficEngine to retrieve more details for this incident. } - + if vehicleRestrictionResultList.count > 0 { let topmostContent = vehicleRestrictionResultList[0] // Note that the text property is empty for general truck restrictions. @@ -758,7 +758,7 @@ class TruckGuidanceExample: TapDelegate, // within a max distance of xx meters from any point of the route. let halfWidthInMeters: Int32 = 200 let routeVertices = route.geometry.vertices - + // The areaCenter specifies a prioritized point within the corridor. // You can choose any coordinate given it's closer to the route and within the corridor. // Following route calculation, the first relevant point is expected to be the start of the route, @@ -773,7 +773,11 @@ class TruckGuidanceExample: TapDelegate, searchOptions.languageCode = .enUs searchOptions.maxItems = 30 - // Note that TruckAmenities require this custom setting. + // Note: TruckAmenities require a custom option when searching online. + // This is not necessary when using the OfflineSearchEngine. + // Additionally, this feature is released as closed-alpha, meaning a license must + // be obtained from the HERE SDK team for online searches. + // Otherwise, a SearchError.FORBIDDEN will occur. _ = searchEngine.setCustomOption(name: "show", value: "truck") searchEngine.search(categoryQuery: categoryQuery, options: searchOptions, completion: { (searchError, items) in @@ -790,6 +794,8 @@ class TruckGuidanceExample: TapDelegate, }) } + // Note: This is a closed-alpha feature that requires an additional license. + // Refer to the comment in searchAlongARoute() for more details. private func logPlaceAmenities(_ place: Place) { let truckAmenities = place.details.truckAmenities if let truckAmenities = truckAmenities {