From eb15219889e2a8b95fdcf7de328175b43c67fe10 Mon Sep 17 00:00:00 2001 From: abkumar Date: Tue, 29 Oct 2024 00:01:35 +0530 Subject: [PATCH] Update example apps for release 4.20.3.0 Signed-off-by: abkumar --- README.md | 2 +- examples/latest/README.md | 2 +- .../com/here/evrouting/EVRoutingExample.java | 2 +- .../java/com/here/search/SearchExample.java | 12 +- .../android/app/build.gradle | 2 +- .../android/app/src/debug/AndroidManifest.xml | 2 +- .../android/app/src/main/AndroidManifest.xml | 4 +- .../MainActivity.java | 2 +- .../app/src/profile/AndroidManifest.xml | 2 +- .../ios/Runner/Info.plist | 2 +- .../custom_polygon_layers_app/pubspec.yaml | 2 +- .../flutter/search_app/lib/SearchExample.dart | 6 +- .../project.pbxproj | 234 +++++++-------- .../AppIcon.appiconset/Contents.json | 89 +----- .../Assets.xcassets/menu.imageset/menu.png | Bin 1276 -> 0 bytes .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Base.lproj/Main.storyboard | 80 ----- .../CameraKeyframeTracksApp.swift | 72 +++++ .../CameraKeyframeTracksExample.swift | 84 ++++-- .../CameraKeyframeTracks/ContentView.swift | 160 ++++++++++ .../CameraKeyframeTracks/Info.plist | 41 --- .../CameraKeyframeTracks/Menu.storyboard | 51 ---- .../MenuViewController.swift | 106 ------- .../Preview Assets.xcassets/Contents.json | 6 + .../RouteAnimationExample.swift | 11 +- .../RouteCalculator.swift | 3 +- .../CameraKeyframeTracks/ViewController.swift | 123 -------- .../ios/CameraKeyframeTracks/README.md | 2 +- .../CustomMapStyles.xcodeproj/project.pbxproj | 247 ++++++++-------- .../AccentColor.colorset}/Contents.json | 3 +- .../AppIcon.appiconset/Contents.json | 97 +----- .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Base.lproj/Main.storyboard | 72 ----- .../CustomMapStyles/ContentView.swift | 80 +++++ .../CustomMapStyles/CustomMapStylesApp.swift | 70 +++++ .../CustomMapStylesExample.swift | 48 ++- .../CustomMapStyles/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../CustomMapStyles/ViewController.swift | 63 ---- .../project.pbxproj | 233 ++++++++------- .../AccentColor.colorset}/Contents.json | 3 +- .../AppIcon.appiconset/Contents.json | 97 +----- .../Assets.xcassets/Contents.json | 6 +- .../poi.imageset/Contents.json | 10 +- .../Assets.xcassets/poi.imageset/poi@1x.png | Bin 2791 -> 0 bytes .../Assets.xcassets/poi.imageset/poi@2x.png | Bin 5633 -> 0 bytes .../Assets.xcassets/poi.imageset/poi@3x.png | Bin 4842 -> 0 bytes .../poi.imageset}/poi_texture.png | Bin .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Base.lproj/Main.storyboard | 72 ----- .../CustomRasterLayers/ContentView.swift | 83 ++++++ .../CustomRasterLayersApp.swift | 72 +++++ .../CustomRasterLayersExample.swift | 37 ++- .../CustomRasterLayers/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../CustomRasterLayers/ViewController.swift | 78 ----- .../explore/ios/CustomRasterLayers/README.md | 2 +- .../EVRouting/EVRouting/RoutingExample.swift | 2 +- .../Gestures.xcodeproj/project.pbxproj | 250 ++++++++-------- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Gestures/Assets.xcassets/Contents.json | 6 +- .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Gestures/Base.lproj/Main.storyboard | 24 -- .../ios/Gestures/Gestures/ContentView.swift | 55 ++++ .../Gestures/GesturesApp.swift} | 45 +-- .../Gestures/Gestures/GesturesExample.swift | 32 +- .../explore/ios/Gestures/Gestures/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../Gestures/Gestures/ViewController.swift | 53 ---- .../PublicTransit.xcodeproj/project.pbxproj | 233 ++++++++------- .../PublicTransit/AppDelegate.swift | 59 ---- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Assets.xcassets/Contents.json | 6 +- .../Base.lproj/LaunchScreen.storyboard | 25 -- .../PublicTransit/Base.lproj/Main.storyboard | 78 ----- .../PublicTransit/ContentView.swift | 80 +++++ .../PublicTransit/PublicTransit/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../PublicTransit/PublicTransitApp.swift | 70 +++++ .../PublicTransit/PublicTransitExample.swift} | 37 ++- .../PublicTransit/ViewController.swift | 61 ---- .../explore/ios/PublicTransit/README.md | 2 +- .../Routing/Routing.xcodeproj/project.pbxproj | 2 +- .../ios/Search/Search/SearchExample.swift | 12 +- examples/latest/explore/ios/Traffic/README.md | 2 +- .../Traffic/Traffic.xcodeproj/project.pbxproj | 246 ++++++++-------- .../ios/Traffic/Traffic/AppDelegate.swift | 59 ---- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Traffic/Assets.xcassets/Contents.json | 6 +- .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Traffic/Base.lproj/Main.storyboard | 72 ----- .../ios/Traffic/Traffic/ContentView.swift | 82 ++++++ .../explore/ios/Traffic/Traffic/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../Traffic/TrafficApp.swift} | 46 +-- .../ios/Traffic/Traffic/TrafficExample.swift | 58 ++-- .../ios/Traffic/Traffic/ViewController.swift | 63 ---- .../com/here/evrouting/EVRoutingExample.java | 2 +- .../navigation/NavigationEventHandler.java | 57 ++-- .../here/offlinemaps/OfflineMapsExample.java | 2 +- .../java/com/here/search/SearchExample.java | 12 +- .../java/com/here/search/SearchExample.java | 24 +- .../truckguidance/TruckGuidanceExample.java | 9 +- .../camera_app/ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../android/app/build.gradle | 2 +- .../android/app/src/debug/AndroidManifest.xml | 2 +- .../android/app/src/main/AndroidManifest.xml | 4 +- .../MainActivity.java | 2 +- .../app/src/profile/AndroidManifest.xml | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/Info.plist | 2 +- .../custom_polygon_layers_app/pubspec.yaml | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../gestures_app/ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../indoor_map_app/lib/drawing_switcher.dart | 2 +- .../flutter/indoor_map_app/lib/main.dart | 4 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../routing_app/ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../search_app/ios/Runner/AppDelegate.swift | 2 +- .../flutter/search_app/lib/SearchExample.dart | 6 +- .../ios/Runner/AppDelegate.swift | 2 +- .../search_hybrid_app/lib/SearchExample.dart | 12 +- .../ios/Runner/AppDelegate.swift | 2 +- .../ios/Runner/AppDelegate.swift | 2 +- .../project.pbxproj | 234 +++++++-------- .../CameraKeyframeTracks/AppDelegate.swift | 59 ---- .../AppIcon.appiconset/Contents.json | 89 +----- .../Assets.xcassets/menu.imageset/menu.png | Bin 1276 -> 0 bytes .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Base.lproj/Main.storyboard | 80 ----- .../CameraKeyframeTracksApp.swift | 72 +++++ .../CameraKeyframeTracksExample.swift | 84 ++++-- .../CameraKeyframeTracks/ContentView.swift | 160 ++++++++++ .../CameraKeyframeTracks/Info.plist | 41 --- .../CameraKeyframeTracks/Menu.storyboard | 51 ---- .../MenuViewController.swift | 106 ------- .../Preview Assets.xcassets/Contents.json | 6 + .../RouteAnimationExample.swift | 11 +- .../RouteCalculator.swift | 3 +- .../CameraKeyframeTracks/ViewController.swift | 123 -------- .../ios/CameraKeyframeTracks/README.md | 2 +- .../CustomMapStyles.xcodeproj/project.pbxproj | 247 ++++++++-------- .../CustomMapStyles/AppDelegate.swift | 59 ---- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Base.lproj/Main.storyboard | 72 ----- .../CustomMapStyles/ContentView.swift | 80 +++++ .../CustomMapStyles/CustomMapStylesApp.swift | 70 +++++ .../CustomMapStylesExample.swift | 48 ++- .../CustomMapStyles/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../CustomMapStyles/ViewController.swift | 63 ---- .../project.pbxproj | 233 ++++++++------- .../CustomRasterLayers/AppDelegate.swift | 59 ---- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Assets.xcassets/Contents.json | 6 +- .../poi.imageset/Contents.json | 10 +- .../Assets.xcassets/poi.imageset/poi@1x.png | Bin 2791 -> 0 bytes .../Assets.xcassets/poi.imageset/poi@2x.png | Bin 5633 -> 0 bytes .../Assets.xcassets/poi.imageset/poi@3x.png | Bin 4842 -> 0 bytes .../poi.imageset}/poi_texture.png | Bin .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Base.lproj/Main.storyboard | 72 ----- .../CustomRasterLayers/ContentView.swift | 83 ++++++ .../CustomRasterLayersApp.swift | 72 +++++ .../CustomRasterLayersExample.swift | 37 ++- .../CustomRasterLayers/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../CustomRasterLayers/ViewController.swift | 78 ----- .../navigate/ios/CustomRasterLayers/README.md | 2 +- .../EVRouting/EVRouting/RoutingExample.swift | 2 +- .../Gestures.xcodeproj/project.pbxproj | 250 ++++++++-------- .../ios/Gestures/Gestures/AppDelegate.swift | 60 ---- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Gestures/Assets.xcassets/Contents.json | 6 +- .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Gestures/Base.lproj/Main.storyboard | 24 -- .../ios/Gestures/Gestures/ContentView.swift | 55 ++++ .../ios/Gestures/Gestures/GesturesApp.swift} | 45 +-- .../Gestures/Gestures/GesturesExample.swift | 32 +- .../navigate/ios/Gestures/Gestures/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../Gestures/Gestures/ViewController.swift | 53 ---- .../project.pbxproj | 276 +++++++++--------- .../NavigationCustom/AppDelegate.swift | 59 ---- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Assets.xcassets/Contents.json | 6 +- .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Base.lproj/Main.storyboard | 81 ----- .../NavigationCustom/ContentView.swift | 83 ++++++ .../NavigationCustom/Info.plist | 41 --- .../NavigationCustomApp.swift | 70 +++++ ...er.swift => NavigationCustomExample.swift} | 82 +++--- .../Preview Assets.xcassets/Contents.json | 6 + .../OfflineMaps/OfflineMapsExample.swift | 2 +- .../PublicTransit.xcodeproj/project.pbxproj | 233 ++++++++------- .../PublicTransit/AppDelegate.swift | 59 ---- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Assets.xcassets/Contents.json | 6 +- .../Base.lproj/LaunchScreen.storyboard | 25 -- .../PublicTransit/Base.lproj/Main.storyboard | 78 ----- .../PublicTransit/ContentView.swift | 80 +++++ .../PublicTransit/PublicTransit/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../PublicTransit/PublicTransitApp.swift | 70 +++++ .../PublicTransit/PublicTransitExample.swift} | 37 ++- .../PublicTransit/ViewController.swift | 61 ---- .../navigate/ios/PublicTransit/README.md | 2 +- .../Routing/Routing.xcodeproj/project.pbxproj | 2 +- .../navigate/ios/RoutingHybrid/README.md | 2 +- .../RoutingHybrid.xcodeproj/project.pbxproj | 234 ++++++++------- .../RoutingHybrid/AppDelegate.swift | 59 ---- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Assets.xcassets/Contents.json | 6 +- .../Base.lproj/LaunchScreen.storyboard | 27 -- .../RoutingHybrid/Base.lproj/Main.storyboard | 111 ------- .../RoutingHybrid/ContentView.swift | 93 ++++++ .../RoutingHybrid/RoutingHybrid/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../RoutingHybrid/RoutingHybridApp.swift} | 37 ++- ...ample.swift => RoutingHybridExample.swift} | 58 ++-- .../RoutingHybrid/ViewController.swift | 81 ----- .../ios/Search/Search/SearchExample.swift | 12 +- .../SearchHybrid/SearchHybridExample.swift | 24 +- .../latest/navigate/ios/Traffic/README.md | 2 +- .../Traffic/Traffic.xcodeproj/project.pbxproj | 246 ++++++++-------- .../ios/Traffic/Traffic/AppDelegate.swift | 59 ---- .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 97 +----- .../Traffic/Assets.xcassets/Contents.json | 6 +- .../Base.lproj/LaunchScreen.storyboard | 25 -- .../Traffic/Base.lproj/Main.storyboard | 72 ----- .../ios/Traffic/Traffic/ContentView.swift | 82 ++++++ .../navigate/ios/Traffic/Traffic/Info.plist | 41 --- .../Preview Assets.xcassets/Contents.json | 6 + .../ios/Traffic/Traffic/TrafficApp.swift | 70 +++++ .../ios/Traffic/Traffic/TrafficExample.swift | 58 ++-- .../ios/Traffic/Traffic/ViewController.swift | 63 ---- .../TruckGuidance/TruckGuidanceExample.swift | 8 +- 261 files changed, 4721 insertions(+), 7292 deletions(-) delete mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/menu.png delete mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/Main.storyboard create mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksApp.swift create mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/ContentView.swift delete mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Info.plist delete mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Menu.storyboard delete mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/MenuViewController.swift create mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/ViewController.swift rename examples/latest/{navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset => explore/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AccentColor.colorset}/Contents.json (70%) delete mode 100644 examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Base.lproj/Main.storyboard create mode 100644 examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/ContentView.swift create mode 100644 examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesApp.swift delete mode 100644 examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Info.plist create mode 100644 examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/ViewController.swift rename examples/latest/explore/ios/{CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset => CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AccentColor.colorset}/Contents.json (70%) delete mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@1x.png delete mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@2x.png delete mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@3x.png rename examples/latest/explore/ios/CustomRasterLayers/{assets => CustomRasterLayers/Assets.xcassets/poi.imageset}/poi_texture.png (100%) delete mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/Main.storyboard create mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/ContentView.swift create mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersApp.swift delete mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Info.plist create mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/ViewController.swift create mode 100644 examples/latest/explore/ios/Gestures/Gestures/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/explore/ios/Gestures/Gestures/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/explore/ios/Gestures/Gestures/Base.lproj/Main.storyboard create mode 100644 examples/latest/explore/ios/Gestures/Gestures/ContentView.swift rename examples/latest/explore/ios/{CustomRasterLayers/CustomRasterLayers/AppDelegate.swift => Gestures/Gestures/GesturesApp.swift} (63%) delete mode 100644 examples/latest/explore/ios/Gestures/Gestures/Info.plist create mode 100644 examples/latest/explore/ios/Gestures/Gestures/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 examples/latest/explore/ios/Gestures/Gestures/ViewController.swift delete mode 100644 examples/latest/explore/ios/PublicTransit/PublicTransit/AppDelegate.swift create mode 100644 examples/latest/explore/ios/PublicTransit/PublicTransit/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/explore/ios/PublicTransit/PublicTransit/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/explore/ios/PublicTransit/PublicTransit/Base.lproj/Main.storyboard create mode 100644 examples/latest/explore/ios/PublicTransit/PublicTransit/ContentView.swift delete mode 100644 examples/latest/explore/ios/PublicTransit/PublicTransit/Info.plist create mode 100644 examples/latest/explore/ios/PublicTransit/PublicTransit/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 examples/latest/explore/ios/PublicTransit/PublicTransit/PublicTransitApp.swift rename examples/latest/{navigate/ios/PublicTransit/PublicTransit/PublicTransportRoutingExample.swift => explore/ios/PublicTransit/PublicTransit/PublicTransitExample.swift} (88%) delete mode 100644 examples/latest/explore/ios/PublicTransit/PublicTransit/ViewController.swift delete mode 100644 examples/latest/explore/ios/Traffic/Traffic/AppDelegate.swift create mode 100644 examples/latest/explore/ios/Traffic/Traffic/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/explore/ios/Traffic/Traffic/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/explore/ios/Traffic/Traffic/Base.lproj/Main.storyboard create mode 100644 examples/latest/explore/ios/Traffic/Traffic/ContentView.swift delete mode 100644 examples/latest/explore/ios/Traffic/Traffic/Info.plist create mode 100644 examples/latest/explore/ios/Traffic/Traffic/Preview Content/Preview Assets.xcassets/Contents.json rename examples/latest/explore/ios/{Gestures/Gestures/AppDelegate.swift => Traffic/Traffic/TrafficApp.swift} (63%) delete mode 100644 examples/latest/explore/ios/Traffic/Traffic/ViewController.swift delete mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/AppDelegate.swift delete mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/menu.png delete mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/Main.storyboard create mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksApp.swift create mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/ContentView.swift delete mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Info.plist delete mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Menu.storyboard delete mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/MenuViewController.swift create mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/ViewController.swift delete mode 100644 examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/AppDelegate.swift create mode 100644 examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Base.lproj/Main.storyboard create mode 100644 examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/ContentView.swift create mode 100644 examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesApp.swift delete mode 100644 examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Info.plist create mode 100644 examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/ViewController.swift delete mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/AppDelegate.swift create mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@1x.png delete mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@2x.png delete mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@3x.png rename examples/latest/navigate/ios/CustomRasterLayers/{assets => CustomRasterLayers/Assets.xcassets/poi.imageset}/poi_texture.png (100%) delete mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/Main.storyboard create mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/ContentView.swift create mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersApp.swift delete mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Info.plist create mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/ViewController.swift delete mode 100644 examples/latest/navigate/ios/Gestures/Gestures/AppDelegate.swift create mode 100644 examples/latest/navigate/ios/Gestures/Gestures/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/navigate/ios/Gestures/Gestures/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/navigate/ios/Gestures/Gestures/Base.lproj/Main.storyboard create mode 100644 examples/latest/navigate/ios/Gestures/Gestures/ContentView.swift rename examples/latest/{explore/ios/CustomMapStyles/CustomMapStyles/AppDelegate.swift => navigate/ios/Gestures/Gestures/GesturesApp.swift} (63%) delete mode 100644 examples/latest/navigate/ios/Gestures/Gestures/Info.plist create mode 100644 examples/latest/navigate/ios/Gestures/Gestures/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 examples/latest/navigate/ios/Gestures/Gestures/ViewController.swift delete mode 100644 examples/latest/navigate/ios/NavigationCustom/NavigationCustom/AppDelegate.swift create mode 100644 examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Base.lproj/Main.storyboard create mode 100644 examples/latest/navigate/ios/NavigationCustom/NavigationCustom/ContentView.swift delete mode 100644 examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Info.plist create mode 100644 examples/latest/navigate/ios/NavigationCustom/NavigationCustom/NavigationCustomApp.swift rename examples/latest/navigate/ios/NavigationCustom/NavigationCustom/{ViewController.swift => NavigationCustomExample.swift} (90%) create mode 100644 examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Preview Content/Preview Assets.xcassets/Contents.json delete mode 100644 examples/latest/navigate/ios/PublicTransit/PublicTransit/AppDelegate.swift create mode 100644 examples/latest/navigate/ios/PublicTransit/PublicTransit/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/navigate/ios/PublicTransit/PublicTransit/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/navigate/ios/PublicTransit/PublicTransit/Base.lproj/Main.storyboard create mode 100644 examples/latest/navigate/ios/PublicTransit/PublicTransit/ContentView.swift delete mode 100644 examples/latest/navigate/ios/PublicTransit/PublicTransit/Info.plist create mode 100644 examples/latest/navigate/ios/PublicTransit/PublicTransit/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 examples/latest/navigate/ios/PublicTransit/PublicTransit/PublicTransitApp.swift rename examples/latest/{explore/ios/PublicTransit/PublicTransit/PublicTransportRoutingExample.swift => navigate/ios/PublicTransit/PublicTransit/PublicTransitExample.swift} (88%) delete mode 100644 examples/latest/navigate/ios/PublicTransit/PublicTransit/ViewController.swift delete mode 100644 examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/AppDelegate.swift create mode 100644 examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Base.lproj/Main.storyboard create mode 100644 examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/ContentView.swift delete mode 100644 examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Info.plist create mode 100644 examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Preview Content/Preview Assets.xcassets/Contents.json rename examples/latest/{explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/AppDelegate.swift => navigate/ios/RoutingHybrid/RoutingHybrid/RoutingHybridApp.swift} (63%) rename examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/{RoutingExample.swift => RoutingHybridExample.swift} (91%) delete mode 100644 examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/ViewController.swift delete mode 100644 examples/latest/navigate/ios/Traffic/Traffic/AppDelegate.swift create mode 100644 examples/latest/navigate/ios/Traffic/Traffic/Assets.xcassets/AccentColor.colorset/Contents.json delete mode 100644 examples/latest/navigate/ios/Traffic/Traffic/Base.lproj/LaunchScreen.storyboard delete mode 100644 examples/latest/navigate/ios/Traffic/Traffic/Base.lproj/Main.storyboard create mode 100644 examples/latest/navigate/ios/Traffic/Traffic/ContentView.swift delete mode 100644 examples/latest/navigate/ios/Traffic/Traffic/Info.plist create mode 100644 examples/latest/navigate/ios/Traffic/Traffic/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 examples/latest/navigate/ios/Traffic/Traffic/TrafficApp.swift delete mode 100644 examples/latest/navigate/ios/Traffic/Traffic/ViewController.swift diff --git a/README.md b/README.md index d2d363ac..49707bf3 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.20.2.0) +## List of Available Example Apps (Version 4.20.3.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 e34cdf0f..93329c1d 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.20.2.0 +This folder contains the HERE SDK examples apps for version: 4.20.3.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/android/EVRouting/app/src/main/java/com/here/evrouting/EVRoutingExample.java b/examples/latest/explore/android/EVRouting/app/src/main/java/com/here/evrouting/EVRoutingExample.java index 5829ad84..270fc570 100644 --- a/examples/latest/explore/android/EVRouting/app/src/main/java/com/here/evrouting/EVRoutingExample.java +++ b/examples/latest/explore/android/EVRouting/app/src/main/java/com/here/evrouting/EVRoutingExample.java @@ -309,7 +309,7 @@ private void searchAlongARoute(Route route) { searchOptions.languageCode = LanguageCode.EN_US; searchOptions.maxItems = 30; - searchEngine.search(textQuery, searchOptions, new SearchCallback() { + searchEngine.searchByText(textQuery, searchOptions, new SearchCallback() { @Override public void onSearchCompleted(SearchError searchError, List items) { if (searchError != null) { diff --git a/examples/latest/explore/android/Search/app/src/main/java/com/here/search/SearchExample.java b/examples/latest/explore/android/Search/app/src/main/java/com/here/search/SearchExample.java index b81eab15..748d7d21 100644 --- a/examples/latest/explore/android/Search/app/src/main/java/com/here/search/SearchExample.java +++ b/examples/latest/explore/android/Search/app/src/main/java/com/here/search/SearchExample.java @@ -148,7 +148,7 @@ private void getAddressForCoordinates(GeoCoordinates geoCoordinates) { reverseGeocodingOptions.languageCode = LanguageCode.EN_GB; reverseGeocodingOptions.maxItems = 1; - searchEngine.search(geoCoordinates, reverseGeocodingOptions, addressSearchCallback); + searchEngine.searchByCoordinates(geoCoordinates, reverseGeocodingOptions, addressSearchCallback); } private final SearchCallback addressSearchCallback = new SearchCallback() { @@ -225,7 +225,7 @@ private void searchInViewport(String queryString) { searchOptions.languageCode = LanguageCode.EN_US; searchOptions.maxItems = 30; - searchEngine.search(query, searchOptions, querySearchCallback); + searchEngine.searchByText(query, searchOptions, querySearchCallback); } private final SearchCallback querySearchCallback = new SearchCallback() { @@ -298,19 +298,19 @@ private void autoSuggestExample() { TextQuery.Area queryArea = new TextQuery.Area(centerGeoCoordinates); // Simulate a user typing a search term. - searchEngine.suggest( + searchEngine.suggestByText( new TextQuery("p", // User typed "p". queryArea), searchOptions, autosuggestCallback); - searchEngine.suggest( + searchEngine.suggestByText( new TextQuery("pi", // User typed "pi". queryArea), searchOptions, autosuggestCallback); - searchEngine.suggest( + searchEngine.suggestByText( new TextQuery("piz", // User typed "piz". queryArea), searchOptions, @@ -326,7 +326,7 @@ private void geocodeAddressAtLocation(String queryString, GeoCoordinates geoCoor options.languageCode = LanguageCode.DE_DE; options.maxItems = 30; - searchEngine.search(query, options, geocodeAddressSearchCallback); + searchEngine.searchByAddress(query, options, geocodeAddressSearchCallback); } private final SearchCallback geocodeAddressSearchCallback = new SearchCallback() { diff --git a/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/build.gradle b/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/build.gradle index 7e19f530..fd02c439 100644 --- a/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/build.gradle +++ b/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/build.gradle @@ -31,7 +31,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.here.sdk.examples.custom_raster_layers_app" + applicationId "com.here.sdk.examples.custom_polygon_layers_app" minSdkVersion 24 targetSdkVersion 34 versionCode flutterVersionCode.toInteger() diff --git a/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/src/debug/AndroidManifest.xml b/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/src/debug/AndroidManifest.xml index 896d391d..dc982f94 100644 --- a/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/src/debug/AndroidManifest.xml +++ b/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.here.sdk.examples.custom_polygon_layers_app"> diff --git a/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/src/main/AndroidManifest.xml b/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/src/main/AndroidManifest.xml index f1674b7d..195dbd45 100644 --- a/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/src/main/AndroidManifest.xml +++ b/examples/latest/explore/flutter/custom_polygon_layers_app/android/app/src/main/AndroidManifest.xml @@ -1,11 +1,11 @@ + package="com.here.sdk.examples.custom_polygon_layers_app"> + package="com.here.sdk.examples.custom_polygon_layers_app"> diff --git a/examples/latest/explore/flutter/custom_polygon_layers_app/ios/Runner/Info.plist b/examples/latest/explore/flutter/custom_polygon_layers_app/ios/Runner/Info.plist index aa1d1069..03df3cc1 100644 --- a/examples/latest/explore/flutter/custom_polygon_layers_app/ios/Runner/Info.plist +++ b/examples/latest/explore/flutter/custom_polygon_layers_app/ios/Runner/Info.plist @@ -11,7 +11,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Custom Raster Layers + Custom Polygon Layers CFBundlePackageType APPL CFBundleShortVersionString diff --git a/examples/latest/explore/flutter/custom_polygon_layers_app/pubspec.yaml b/examples/latest/explore/flutter/custom_polygon_layers_app/pubspec.yaml index ca5a1867..8cdec1ab 100644 --- a/examples/latest/explore/flutter/custom_polygon_layers_app/pubspec.yaml +++ b/examples/latest/explore/flutter/custom_polygon_layers_app/pubspec.yaml @@ -1,4 +1,4 @@ -name: custom_raster_layers_app +name: custom_polygon_layers_app description: A new Flutter app that uses the HERE SDK for Flutter. # The following line prevents the package from being accidentally published to diff --git a/examples/latest/explore/flutter/search_app/lib/SearchExample.dart b/examples/latest/explore/flutter/search_app/lib/SearchExample.dart index 125eded6..d4582ce4 100644 --- a/examples/latest/explore/flutter/search_app/lib/SearchExample.dart +++ b/examples/latest/explore/flutter/search_app/lib/SearchExample.dart @@ -222,7 +222,7 @@ class SearchExample { TextQueryArea queryArea = TextQueryArea.withCenter(centerGeoCoordinates); // Simulate a user typing a search term. - _searchEngine.suggest( + _searchEngine.suggestByText( TextQuery.withArea( "p", // User typed "p". queryArea), @@ -230,7 +230,7 @@ class SearchExample { _handleSuggestionResults(searchError, list); }); - _searchEngine.suggest( + _searchEngine.suggestByText( TextQuery.withArea( "pi", // User typed "pi". queryArea), @@ -238,7 +238,7 @@ class SearchExample { _handleSuggestionResults(searchError, list); }); - _searchEngine.suggest( + _searchEngine.suggestByText( TextQuery.withArea( "piz", // User typed "piz". queryArea), diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks.xcodeproj/project.pbxproj b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks.xcodeproj/project.pbxproj index 0165b9e9..510730ed 100644 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks.xcodeproj/project.pbxproj @@ -3,32 +3,29 @@ archiveVersion = 1; classes = { }; - objectVersion = 55; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - 8680500927FEC05700B4F52A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8680500827FEC05700B4F52A /* AppDelegate.swift */; }; - 8680500D27FEC05700B4F52A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8680500C27FEC05700B4F52A /* ViewController.swift */; }; - 8680501027FEC05700B4F52A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8680500E27FEC05700B4F52A /* Main.storyboard */; }; - 8680501227FEC05900B4F52A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8680501127FEC05900B4F52A /* Assets.xcassets */; }; - 8680501527FEC05900B4F52A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8680501327FEC05900B4F52A /* LaunchScreen.storyboard */; }; - 869BC1D528045EA500BBA419 /* Menu.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 869BC1D428045EA500BBA419 /* Menu.storyboard */; }; - 869BC1D728045F7B00BBA419 /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 869BC1D628045F7B00BBA419 /* MenuViewController.swift */; }; - 869BC1DA2804606F00BBA419 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 869BC1D92804606F00BBA419 /* heresdk.xcframework */; }; - 869BC1DB2804606F00BBA419 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 869BC1D92804606F00BBA419 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 869BC1E42804613500BBA419 /* RouteAnimationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 869BC1E32804613500BBA419 /* RouteAnimationExample.swift */; }; - 869BC1E62804615700BBA419 /* RouteCalculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 869BC1E52804615700BBA419 /* RouteCalculator.swift */; }; - 869BC1E82804617B00BBA419 /* CameraKeyframeTracksExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 869BC1E72804617B00BBA419 /* CameraKeyframeTracksExample.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 */; }; + 8641F3032CCA9F36005F6F3F /* CameraKeyframeTracksExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8641F3022CCA9F23005F6F3F /* CameraKeyframeTracksExample.swift */; }; + 8641F3052CCA9F72005F6F3F /* CameraKeyframeTracksApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8641F3042CCA9F6A005F6F3F /* CameraKeyframeTracksApp.swift */; }; + 8641F3082CCA9FB2005F6F3F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8641F3072CCA9FAC005F6F3F /* ContentView.swift */; }; + 8658A30D2CCBE75E00B4BF3E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 8658A30F2CCBE77300B4BF3E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8658A30E2CCBE77300B4BF3E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 86D2C6F72CCB6ACB0060CAA8 /* RouteAnimationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86D2C6F62CCB6AC80060CAA8 /* RouteAnimationExample.swift */; }; + 86D2C6F92CCB6AEC0060CAA8 /* RouteCalculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86D2C6F82CCB6AEA0060CAA8 /* RouteCalculator.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - 869BC1DC2804606F00BBA419 /* Embed Frameworks */ = { + 8658A30C2CCBE6BE00B4BF3E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - 869BC1DB2804606F00BBA419 /* heresdk.xcframework in Embed Frameworks */, + 8658A30F2CCBE77300B4BF3E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -36,72 +33,74 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 8680500527FEC05700B4F52A /* CameraKeyframeTracks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CameraKeyframeTracks.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 8680500827FEC05700B4F52A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 8680500C27FEC05700B4F52A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 8680500F27FEC05700B4F52A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 8680501127FEC05900B4F52A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 8680501427FEC05900B4F52A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 8680501627FEC05900B4F52A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 869BC1D428045EA500BBA419 /* Menu.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Menu.storyboard; sourceTree = ""; }; - 869BC1D628045F7B00BBA419 /* MenuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuViewController.swift; sourceTree = ""; }; - 869BC1D92804606F00BBA419 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; - 869BC1E32804613500BBA419 /* RouteAnimationExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteAnimationExample.swift; sourceTree = ""; }; - 869BC1E52804615700BBA419 /* RouteCalculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteCalculator.swift; sourceTree = ""; }; - 869BC1E72804617B00BBA419 /* CameraKeyframeTracksExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraKeyframeTracksExample.swift; sourceTree = ""; }; + 83C837B82C207F340004F54E /* CameraKeyframeTracks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CameraKeyframeTracks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = ""; }; + 8641F3022CCA9F23005F6F3F /* CameraKeyframeTracksExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraKeyframeTracksExample.swift; sourceTree = ""; }; + 8641F3042CCA9F6A005F6F3F /* CameraKeyframeTracksApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraKeyframeTracksApp.swift; sourceTree = ""; }; + 8641F3072CCA9FAC005F6F3F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 8658A30E2CCBE77300B4BF3E /* heresdk.xcframework */ = {isa = PBXFileReference; + lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 86D2C6F62CCB6AC80060CAA8 /* RouteAnimationExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteAnimationExample.swift; sourceTree = ""; }; + 86D2C6F82CCB6AEA0060CAA8 /* RouteCalculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteCalculator.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 8680500227FEC05700B4F52A /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 869BC1DA2804606F00BBA419 /* heresdk.xcframework in Frameworks */, + 8658A30D2CCBE75E00B4BF3E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 86804FFC27FEC05700B4F52A = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - 8680500727FEC05700B4F52A /* CameraKeyframeTracks */, - 8680500627FEC05700B4F52A /* Products */, - 869BC1D82804606F00BBA419 /* Frameworks */, + 8658A30E2CCBE77300B4BF3E /* heresdk.xcframework */, + 83C837BA2C207F340004F54E /* CameraKeyframeTracks */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - 8680500627FEC05700B4F52A /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - 8680500527FEC05700B4F52A /* CameraKeyframeTracks.app */, + 83C837B82C207F340004F54E /* CameraKeyframeTracks.app */, ); name = Products; sourceTree = ""; }; - 8680500727FEC05700B4F52A /* CameraKeyframeTracks */ = { + 83C837BA2C207F340004F54E /* CameraKeyframeTracks */ = { isa = PBXGroup; children = ( - 8680500E27FEC05700B4F52A /* Main.storyboard */, - 8680501127FEC05900B4F52A /* Assets.xcassets */, - 8680501327FEC05900B4F52A /* LaunchScreen.storyboard */, - 8680501627FEC05900B4F52A /* Info.plist */, - 869BC1D428045EA500BBA419 /* Menu.storyboard */, - 8680500827FEC05700B4F52A /* AppDelegate.swift */, - 8680500C27FEC05700B4F52A /* ViewController.swift */, - 869BC1D628045F7B00BBA419 /* MenuViewController.swift */, - 869BC1E32804613500BBA419 /* RouteAnimationExample.swift */, - 869BC1E52804615700BBA419 /* RouteCalculator.swift */, - 869BC1E72804617B00BBA419 /* CameraKeyframeTracksExample.swift */, + 86D2C6F82CCB6AEA0060CAA8 /* RouteCalculator.swift */, + 86D2C6F62CCB6AC80060CAA8 /* RouteAnimationExample.swift */, + 8641F3042CCA9F6A005F6F3F /* CameraKeyframeTracksApp.swift */, + 8641F3022CCA9F23005F6F3F /* CameraKeyframeTracksExample.swift */, + 8641F3072CCA9FAC005F6F3F /* ContentView.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = CameraKeyframeTracks; sourceTree = ""; }; - 869BC1D82804606F00BBA419 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - 869BC1D92804606F00BBA419 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -109,14 +108,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 8680500427FEC05700B4F52A /* CameraKeyframeTracks */ = { + 83C837B72C207F340004F54E /* CameraKeyframeTracks */ = { isa = PBXNativeTarget; - buildConfigurationList = 8680501927FEC05900B4F52A /* Build configuration list for PBXNativeTarget "CameraKeyframeTracks" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CameraKeyframeTracks" */; buildPhases = ( - 8680500127FEC05700B4F52A /* Sources */, - 8680500227FEC05700B4F52A /* Frameworks */, - 8680500327FEC05700B4F52A /* Resources */, - 869BC1DC2804606F00BBA419 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 8658A30C2CCBE6BE00B4BF3E /* Embed Frameworks */, ); buildRules = ( ); @@ -124,100 +123,78 @@ ); name = CameraKeyframeTracks; productName = CameraKeyframeTracks; - productReference = 8680500527FEC05700B4F52A /* CameraKeyframeTracks.app */; + productReference = 83C837B82C207F340004F54E /* CameraKeyframeTracks.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 86804FFD27FEC05700B4F52A /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1300; - LastUpgradeCheck = 1300; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - 8680500427FEC05700B4F52A = { - CreatedOnToolsVersion = 13.0; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = 8680500027FEC05700B4F52A /* Build configuration list for PBXProject "CameraKeyframeTracks" */; - compatibilityVersion = "Xcode 13.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CameraKeyframeTracks" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = 86804FFC27FEC05700B4F52A; - productRefGroup = 8680500627FEC05700B4F52A /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 8680500427FEC05700B4F52A /* CameraKeyframeTracks */, + 83C837B72C207F340004F54E /* CameraKeyframeTracks */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 8680500327FEC05700B4F52A /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8680501527FEC05900B4F52A /* LaunchScreen.storyboard in Resources */, - 8680501227FEC05900B4F52A /* Assets.xcassets in Resources */, - 8680501027FEC05700B4F52A /* Main.storyboard in Resources */, - 869BC1D528045EA500BBA419 /* Menu.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 8680500127FEC05700B4F52A /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 869BC1E62804615700BBA419 /* RouteCalculator.swift in Sources */, - 869BC1E42804613500BBA419 /* RouteAnimationExample.swift in Sources */, - 8680500D27FEC05700B4F52A /* ViewController.swift in Sources */, - 869BC1D728045F7B00BBA419 /* MenuViewController.swift in Sources */, - 8680500927FEC05700B4F52A /* AppDelegate.swift in Sources */, - 869BC1E82804617B00BBA419 /* CameraKeyframeTracksExample.swift in Sources */, + 86D2C6F72CCB6ACB0060CAA8 /* RouteAnimationExample.swift in Sources */, + 8641F3082CCA9FB2005F6F3F /* ContentView.swift in Sources */, + 8641F3052CCA9F72005F6F3F /* CameraKeyframeTracksApp.swift in Sources */, + 8641F3032CCA9F36005F6F3F /* CameraKeyframeTracksExample.swift in Sources */, + 86D2C6F92CCB6AEC0060CAA8 /* RouteCalculator.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - 8680500E27FEC05700B4F52A /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 8680500F27FEC05700B4F52A /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 8680501327FEC05900B4F52A /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 8680501427FEC05900B4F52A /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - 8680501727FEC05900B4F52A /* 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++17"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -247,7 +224,8 @@ 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; @@ -262,23 +240,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - 8680501827FEC05900B4F52A /* 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++17"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -308,7 +287,8 @@ 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; @@ -317,29 +297,29 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - 8680501A27FEC05900B4F52A /* 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 = "\"CameraKeyframeTracks/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; + ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = CameraKeyframeTracks/Info.plist; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 15.0; @@ -348,7 +328,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -356,20 +336,20 @@ }; name = Debug; }; - 8680501B27FEC05900B4F52A /* 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 = "\"CameraKeyframeTracks/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; + ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = CameraKeyframeTracks/Info.plist; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 15.0; @@ -378,7 +358,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -389,25 +369,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 8680500027FEC05700B4F52A /* Build configuration list for PBXProject "CameraKeyframeTracks" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CameraKeyframeTracks" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8680501727FEC05900B4F52A /* Debug */, - 8680501827FEC05900B4F52A /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8680501927FEC05900B4F52A /* Build configuration list for PBXNativeTarget "CameraKeyframeTracks" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CameraKeyframeTracks" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8680501A27FEC05900B4F52A /* Debug */, - 8680501B27FEC05900B4F52A /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 86804FFD27FEC05700B4F52A /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/AppIcon.appiconset/Contents.json index 9221b9bb..13613e3e 100644 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,93 +1,8 @@ { "images" : [ { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", + "idiom" : "universal", + "platform" : "ios", "size" : "1024x1024" } ], diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/menu.png b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/menu.png deleted file mode 100644 index 54ee7c36901f19ac258e373f11c21d1817be6db0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1276 zcmVP000>X1^@s6#OZ}&000CIX+uL$YePpv zZ)|UJQ*dEpWk+RhWpZg_Qb$4n062|}Rb6NtRTMs(xw9)I&V$sZrjic+HI%e$QqhFk z=>BE1ZQLxAY_vg;$?V;oX(lt{{G@3qJ`_O^!KmPq;Qw2}Cn0L9?Tam?khm;cmfj@-EE=vY<#k5o0f^m&*sM6pBI0EL{uRZtU4R5Z z`^X8`V)zNfJ8YaF;u6EP09P2E5Ad?jnUOMxUqvh^s*L``+lU9}BlcPZ2XpY-jyyG} zttleQMaed+noc9ry@UIIwng1*#M^^UkFzj+6yF25_LnMhmf?pGpH<}CbcnAmX|u%; z|7E#p3GpKUUAw%6atiT2#A8)^yd3Cssj4^8z$>TJnP(8+gLrkpJj%xIMEtceUz`ec zeo~wa<_{hK;NmJRuzL3+9o0iVC08s$)vACv7|KExH6jmbd4gn8^0FkllzkRT6fd|P0n zrwSVAXrbt(XrcJk;OyVRDf#{Yw^VBW$m{6QFhZvPBk<6w!tZERBfJcLd1$M3&)TehHS09YRtkN(Z(GDi^F2;vKBX;HY+Q*UEnTqUvgh@A9J5aYSek}G;8j! zqp=F+X_rylpF&#LEj%b>g+0Q~5^H*5N-?MwSLAe5T{?GXqX;9WfX;*4pXw6&V*io?m|<6;W0GAb4f<-njQ>$>Q>9MPr@ zwU=n+0I+*9IKpp9{{0u*d8K7@p9VPmCp-6AwmA>rtOL;dXv;Q$XXCx^0IWWyc=l3w zC&Xgk0yx!!!@*Zi8qcdA>-AfBZYACT*nGWS|NH%Vee(m<-vGFv{{#Oecnig2*2@3@ z061k>NoGw=04e|g00;m9hiL!=000010000Q0000000N)_00aO40096102!bI00aO4 z0096102u%P004VCwPXMQ0A)!;K~zW$V`N}p_z%Q11xz$G9cuWfCG-g8Q9Fiu2rvRY zfGx-0p}=D*=z4Kkg07At{_x51EI7h}>Tv?IhaJcuHTb^6G>_6lD+ER}BT4Z^YQ7-J maF}9jIsOw&l1!QpT^|6xJ_sB_lsmux0000 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/Main.storyboard b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/Main.storyboard deleted file mode 100644 index 028accb8..00000000 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/Main.storyboard +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksApp.swift b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksApp.swift new file mode 100644 index 00000000..67d86440 --- /dev/null +++ b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksApp.swift @@ -0,0 +1,72 @@ + +/* + * 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 CameraKeyframeTracksApp: 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/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksExample.swift b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksExample.swift index 456ce776..3c69cf9f 100644 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksExample.swift +++ b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksExample.swift @@ -17,40 +17,41 @@ * License-Filename: LICENSE */ -import UIKit import heresdk +import SwiftUI -public class CameraKeyframeTracksExample: AnimationDelegate { +/// `CameraKeyframeTracksExample` provides functionality for animating the map camera along a series of keyframes. +class CameraKeyframeTracksExample: AnimationDelegate { private final let tag = String(describing: CameraKeyframeTracksExample.self) - private let viewController: UIViewController - private var mapView: MapView! - private var tracks: [MapCameraKeyframeTrack]! private let geoCoordinates = GeoCoordinates(latitude: 40.685869754854544, longitude: -74.02550202768754) + private var tracks: [MapCameraKeyframeTrack]! + private var mapView: MapView + private var disableOptimization = true + private var waypoints: Array = Array() - 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), + zoom: distanceInMeters) + + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) } - public func startTripToNYC() { - // This animation can be started and replayed. When started, it will always start from globe view. - let mapCameraKeyframeTracks: [MapCameraKeyframeTrack]? = createMapCameraKeyframeTracks() - - let mapCameraAnimation: MapCameraAnimation - - do { - mapCameraAnimation = try MapCameraAnimationFactory.createAnimation(tracks: mapCameraKeyframeTracks!) - } catch let mapCameraKeyframeTrackException { - print(tag + "Error occured: " + mapCameraKeyframeTrackException.localizedDescription) - return + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + guard mapError == nil else { + print("Error: Map scene not loaded, \(String(describing: mapError))") + return } - - // This animation can be started and replayed. When started, it will always start from the first keyframe. - mapView.camera.startAnimation(mapCameraAnimation, animationDelegate: self) } - - public func onAnimationStateChanged(state: AnimationState) { + + func onAnimationStateChanged(state: heresdk.AnimationState) { switch (state) { case .started: print(tag + "Animation started.") @@ -67,6 +68,23 @@ public class CameraKeyframeTracksExample: AnimationDelegate { } } + public func startTripToNYC() { + // This animation can be started and replayed. When started, it will always start from globe view. + let mapCameraKeyframeTracks: [MapCameraKeyframeTrack]? = createMapCameraKeyframeTracks() + + let mapCameraAnimation: MapCameraAnimation + + do { + mapCameraAnimation = try MapCameraAnimationFactory.createAnimation(tracks: mapCameraKeyframeTracks!) + } catch let mapCameraKeyframeTrackException { + print(tag + "Error occured: " + mapCameraKeyframeTrackException.localizedDescription) + return + } + + // This animation can be started and replayed. When started, it will always start from the first keyframe. + mapView.camera.startAnimation(mapCameraAnimation, animationDelegate: self) + } + public func stopTripToNYCAnimation() { mapView.camera.cancelAnimations() } @@ -165,9 +183,21 @@ public class CameraKeyframeTracksExample: AnimationDelegate { return geoOrientationKeyframe } - 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 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/CameraKeyframeTracks/CameraKeyframeTracks/ContentView.swift b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/ContentView.swift new file mode 100644 index 00000000..bf7590c9 --- /dev/null +++ b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/ContentView.swift @@ -0,0 +1,160 @@ +/* + * Copyright (C) 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 variable to control the visibility of the menu. + @State private var showMenu = false + @State private var mapView = MapView() + @State private var cameraKeyframeTracksExample: CameraKeyframeTracksExample? + @State private var routeAnimationExample: RouteAnimationExample? + + var body: some View { + NavigationView { + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + + VStack { + HStack { + CustomMenuButton(showMenu: $showMenu) + Spacer() + } + Spacer() + } + } + .sheet(isPresented: $showMenu) { + // Presents the menu view as a sheet when showMenu is true. + MenuView(menuSections: buildMenuSections()) + } + .onAppear { + // ContentView appeared, now we init the examples. + cameraKeyframeTracksExample = CameraKeyframeTracksExample(mapView) + routeAnimationExample = RouteAnimationExample(mapView) + } + } + } + + /// Builds the sections for the menu. Each section contains items that trigger animations. + /// + /// - Returns: An array of `MenuSection` representing the available menu items. + private func buildMenuSections() -> [MenuSection] { + return [ + MenuSection(title: "Animate to Route", items: [ + MenuItem(title: "Start Animation", onSelect: onStartAnimationToRouteButtonClicked), + MenuItem(title: "Stop Animation", onSelect: onStopAnimationToRouteButtonClicked) + ]), + MenuSection(title: "Trip to NYC", items: [ + MenuItem(title: "Start trip to NYC", onSelect: onStartTripToNYCButtonClicked), + MenuItem(title: "Stop trip to NYC", onSelect: onStopTripToNYCButtonClicked) + ]) + ] + } + + /// Represents a menu item in the menu view. + struct MenuItem { + let title: String + let onSelect: () -> Void + } + + /// Represents a section in the menu view, which contains a list of menu items. + struct MenuSection { + let title: String + let items: [MenuItem] + } + + /// View for displaying the menu. Each menu section and item triggers its respective action. + struct MenuView: View { + var menuSections: [MenuSection] + @Environment(\.dismiss) var dismiss + + var body: some View { + NavigationView { + List { + ForEach(menuSections, id: \.title) { section in + Section(header: Text(section.title)) { + ForEach(section.items, id: \.title) { item in + Button(action: { + item.onSelect() + dismiss() + }) { + Text(item.title) + } + } + } + } + } + .navigationBarTitle("Menu") + } + } + } + + private func onStartAnimationToRouteButtonClicked() { + routeAnimationExample?.animateToRoute() + } + + private func onStopAnimationToRouteButtonClicked() { + routeAnimationExample?.stopRouteAnimation() + } + + private func onStartTripToNYCButtonClicked() { + cameraKeyframeTracksExample?.startTripToNYC() + } + + private func onStopTripToNYCButtonClicked() { + cameraKeyframeTracksExample?.stopTripToNYCAnimation() + } + + /// `CustomMenuButton` is a reusable SwiftUI view that displays a button with a menu icon. + private struct CustomMenuButton: View { + // Use @Binding to connect to the state from the parent view. + @Binding var showMenu: Bool + + var body: some View { + Button(action: { + showMenu.toggle() + }) { + Image(systemName: "line.horizontal.3") + .resizable() + .frame(width: 25, height: 25) + } + .padding() + } + } + + /// `WrappedMapView` is a wrapper around the HERE SDK `MapView` to make it compatible with SwiftUI. + /// It uses `UIViewRepresentable` to bridge UIKit with SwiftUI + 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/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Info.plist b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/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/CameraKeyframeTracks/CameraKeyframeTracks/Menu.storyboard b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Menu.storyboard deleted file mode 100644 index 6938d6ab..00000000 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Menu.storyboard +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/MenuViewController.swift b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/MenuViewController.swift deleted file mode 100644 index 53561ce5..00000000 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/MenuViewController.swift +++ /dev/null @@ -1,106 +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 UIKit - -struct MenuItem { - let title: String - let onSelect: (Any) -> Void -} - -struct MenuSection { - let title: String - let items: [MenuItem] -} - -// A helper class to show a menu. -class MenuViewController: UIViewController { - - var menuSections: [MenuSection] = [] - - override func viewDidLoad() { - super.viewDidLoad() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } -} - -extension MenuViewController: UITableViewDataSource { - - func numberOfSections(in tableView: UITableView) -> Int { - return menuSections.count - } - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - guard section >= 0, section < menuSections.count else { - return 0 - } - - return menuSections[section].items.count - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - - let cell = tableView.dequeueReusableCell(withIdentifier: "MenuItem", for: indexPath) - - let section = indexPath.section - guard section >= 0, section < menuSections.count else { - return cell - } - - let row = indexPath.row - guard row >= 0, row < menuSections[section].items.count else { - return cell - } - - cell.textLabel?.text = menuSections[section].items[row].title - return cell - } - - func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - guard section >= 0, section < menuSections.count else { - return nil - } - - return menuSections[section].title - } -} - -extension MenuViewController: UITableViewDelegate { - - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let section = indexPath.section - guard section >= 0, section < menuSections.count else { - dismiss(animated: true, completion: nil) - return - } - - let row = indexPath.row - guard row >= 0, row < menuSections[section].items.count else { - dismiss(animated: true, completion: nil) - return - } - - menuSections[section].items[row].onSelect(self) - dismiss(animated: true, completion: nil) - } -} - diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteAnimationExample.swift b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteAnimationExample.swift index 61b47bfe..d5707980 100644 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteAnimationExample.swift +++ b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteAnimationExample.swift @@ -17,12 +17,13 @@ * License-Filename: LICENSE */ -import UIKit +import SwiftUI import heresdk +/// `RouteAnimationExample` is responsible for animating the camera along a predefined route on the HERE SDK map. +/// This class provides functions to start and stop route animations, moving the camera to display a route with transitions. public class RouteAnimationExample { - - private let viewController: UIViewController + private var mapView: MapView! private var tracks: [MapCameraKeyframeTrack]! private var mapPolylines: [MapPolyline] = [] @@ -30,8 +31,7 @@ public class RouteAnimationExample { private var route: Route? private let geoCoordinates = GeoCoordinates(latitude: 40.685869754854544, longitude: -74.02550202768754) - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView routeCalculator = RouteCalculator(mapView: mapView) @@ -67,3 +67,4 @@ public class RouteAnimationExample { mapView.camera.startAnimation(animation) } } + diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteCalculator.swift b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteCalculator.swift index b87b9716..9ab1a3cc 100644 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteCalculator.swift +++ b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteCalculator.swift @@ -18,7 +18,7 @@ */ import heresdk -import UIKit +import SwiftUI // A class that creates car Routes with the HERE SDK. public class RouteCalculator { @@ -75,3 +75,4 @@ public class RouteCalculator { } } } + diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/ViewController.swift b/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/ViewController.swift deleted file mode 100644 index 077a5510..00000000 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/ViewController.swift +++ /dev/null @@ -1,123 +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 cameraKeyframeTracksExample: CameraKeyframeTracksExample! - private var routeAnimationExample: RouteAnimationExample! - private var isMapSceneLoaded = true - private var menuSections: [MenuSection] = [] - private let geoCoordinates = GeoCoordinates(latitude: 40.71083291395444, longitude: -74.01226399217569) - - 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) - - menuSections = buildMenuSections() - } - - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - // Users of the Navigate Edition can enable textured landmarks: - // mapView.mapScene.enableFeatures([MapFeatures.landmarks : MapFeatureModes.landmarksTextured]) - - let distanceInMeters = MapMeasure(kind: .distance, value: 5000) - mapView.camera.lookAt(point: geoCoordinates, zoom: distanceInMeters) - - // Start the examples. - isMapSceneLoaded = true - cameraKeyframeTracksExample = CameraKeyframeTracksExample(viewController: self, mapView: mapView) - routeAnimationExample = RouteAnimationExample(viewController: self, mapView: mapView) - } - - public override func prepare(for segue: UIStoryboardSegue, sender _: Any?) { - if segue.identifier == "showMenu" { - if let vc = segue.destination as? MenuViewController { - vc.menuSections = menuSections - } - } - } - - @IBAction func onMenuButtonClicked(_ sender: UIBarButtonItem) { - performSegue(withIdentifier: "showMenu", sender: nil) - } - - private func onStartAnimationToRouteButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - - routeAnimationExample.animateToRoute() - } - } - - private func onStopAnimationToRouteButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - routeAnimationExample.stopRouteAnimation() - } - } - - private func onStartTripToNYCButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraKeyframeTracksExample.startTripToNYC() - } - } - - private func onStopTripToNYCButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraKeyframeTracksExample.stopTripToNYCAnimation() - } - } - - // A helper method to build drawer menu items. - private func buildMenuSections() -> [MenuSection] { - return [ - buildAnimateToRouteMenuSection(), - buildTripToNYCMenuSection(), - ] - } - - private func buildAnimateToRouteMenuSection() -> MenuSection { - return MenuSection(title: "Animate to route", items: [ - MenuItem(title: "Start Animation", onSelect: onStartAnimationToRouteButtonClicked), - MenuItem(title: "Stop Animation", onSelect: onStopAnimationToRouteButtonClicked), - ]) - } - - private func buildTripToNYCMenuSection() -> MenuSection { - return MenuSection(title: "Trip to NYC", items: [ - MenuItem(title: "Start trip to NYC", onSelect: onStartTripToNYCButtonClicked), - MenuItem(title: "Stop trip to NYC", onSelect: onStopTripToNYCButtonClicked) - ]) - } - - public override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} - diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/README.md b/examples/latest/explore/ios/CameraKeyframeTracks/README.md index 119a5b24..e7c78ac5 100644 --- a/examples/latest/explore/ios/CameraKeyframeTracks/README.md +++ b/examples/latest/explore/ios/CameraKeyframeTracks/README.md @@ -1,4 +1,4 @@ -The CameraKeyframeTracks example app shows how to use multiple keyframe tracks for map camera animations and how to animate to a route. You can find how this is done in [CameraKeyframeTracksExample.swift](lib/animations/CameraKeyframeTracksExample.swift). +The CameraKeyframeTracks example app shows how to use multiple keyframe tracks for map camera animations and how to animate to a route. You can find how this is done in [CameraKeyframeTracksExample.swift](CameraKeyframeTracksExample.swift). Build instructions: ------------------- diff --git a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles.xcodeproj/project.pbxproj b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles.xcodeproj/project.pbxproj index 8e4853a1..beb845e6 100644 --- a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles.xcodeproj/project.pbxproj @@ -3,29 +3,28 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - C81C80EC28735FF60074166F /* custom-dark-style-neon-rds.json in Resources */ = {isa = PBXBuildFile; fileRef = C81C80EB28735FF60074166F /* custom-dark-style-neon-rds.json */; }; - 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 */; }; - C8553C4D25B2294800E95722 /* CustomMapStylesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8553C4C25B2294800E95722 /* CustomMapStylesExample.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, ); }; }; + 83C066BF2CC80307007A890F /* custom-dark-style-neon-rds.json in Resources */ = {isa = PBXBuildFile; fileRef = 83C066BE2CC80307007A890F /* custom-dark-style-neon-rds.json */; }; + 83C837BC2C207F340004F54E /* CustomMapStylesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* CustomMapStylesApp.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 /* CustomMapStylesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* CustomMapStylesExample.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; @@ -33,74 +32,78 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C81C80EB28735FF60074166F /* custom-dark-style-neon-rds.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "custom-dark-style-neon-rds.json"; sourceTree = ""; }; - C827C53F2329371C003AA0C5 /* CustomMapStyles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomMapStyles.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 = ""; }; - C8553C4C25B2294800E95722 /* CustomMapStylesExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMapStylesExample.swift; sourceTree = ""; }; - C88C019123CDFDD500043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C066BE2CC80307007A890F /* custom-dark-style-neon-rds.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "custom-dark-style-neon-rds.json"; sourceTree = ""; }; + 83C837B82C207F340004F54E /* CustomMapStyles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomMapStyles.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* CustomMapStylesApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMapStylesApp.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 /* CustomMapStylesExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMapStylesExample.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 */ - C81C80EA28735FF60074166F /* assets */ = { + 83C066BD2CC80307007A890F /* assets */ = { isa = PBXGroup; children = ( - C81C80EB28735FF60074166F /* custom-dark-style-neon-rds.json */, + 83C066BE2CC80307007A890F /* custom-dark-style-neon-rds.json */, ); path = assets; sourceTree = ""; }; - C827C5362329371C003AA0C5 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C81C80EA28735FF60074166F /* assets */, - C827C5412329371C003AA0C5 /* CustomMapStyles */, - C827C5402329371C003AA0C5 /* Products */, - C88C019023CDFDD400043918 /* Frameworks */, + 83C066BD2CC80307007A890F /* assets */, + 83C837BA2C207F340004F54E /* CustomMapStyles */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C827C5402329371C003AA0C5 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C827C53F2329371C003AA0C5 /* CustomMapStyles.app */, + 83C837B82C207F340004F54E /* CustomMapStyles.app */, ); name = Products; sourceTree = ""; }; - C827C5412329371C003AA0C5 /* CustomMapStyles */ = { + 83C837BA2C207F340004F54E /* CustomMapStyles */ = { isa = PBXGroup; children = ( - C827C5422329371C003AA0C5 /* AppDelegate.swift */, - C827C5442329371C003AA0C5 /* ViewController.swift */, - C8553C4C25B2294800E95722 /* CustomMapStylesExample.swift */, - C827C5462329371C003AA0C5 /* Main.storyboard */, - C827C54923293725003AA0C5 /* Assets.xcassets */, - C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */, - C827C54E23293726003AA0C5 /* Info.plist */, + 83C837BB2C207F340004F54E /* CustomMapStylesApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* CustomMapStylesExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = CustomMapStyles; 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 = ""; @@ -108,14 +111,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C827C53E2329371C003AA0C5 /* CustomMapStyles */ = { + 83C837B72C207F340004F54E /* CustomMapStyles */ = { isa = PBXNativeTarget; - buildConfigurationList = C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "CustomMapStyles" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CustomMapStyles" */; buildPhases = ( - C827C53B2329371C003AA0C5 /* Sources */, - C827C53C2329371C003AA0C5 /* Frameworks */, - C827C53D2329371C003AA0C5 /* Resources */, - C827C559232938DA003AA0C5 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -123,98 +126,77 @@ ); name = CustomMapStyles; productName = CustomMapStyles; - productReference = C827C53F2329371C003AA0C5 /* CustomMapStyles.app */; + productReference = 83C837B82C207F340004F54E /* CustomMapStyles.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 = 1030; - 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 "CustomMapStyles" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CustomMapStyles" */; + 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 /* CustomMapStyles */, + 83C837B72C207F340004F54E /* CustomMapStyles */, ); }; /* 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 */, - C81C80EC28735FF60074166F /* custom-dark-style-neon-rds.json in Resources */, - C827C5482329371C003AA0C5 /* Main.storyboard in Resources */, + 83C066BF2CC80307007A890F /* custom-dark-style-neon-rds.json 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 = ( - C8553C4D25B2294800E95722 /* CustomMapStylesExample.swift in Sources */, - C827C5452329371C003AA0C5 /* ViewController.swift in Sources */, - C827C5432329371C003AA0C5 /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* CustomMapStylesApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* CustomMapStylesExample.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; @@ -233,18 +215,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; @@ -259,23 +242,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; @@ -294,18 +278,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; @@ -314,58 +299,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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 = "\"CustomMapStyles/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CustomMapStyles/Info.plist; + 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 = 15.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 = "\"CustomMapStyles/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CustomMapStyles/Info.plist; + 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 = 15.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"; }; @@ -374,25 +371,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C827C53A2329371C003AA0C5 /* Build configuration list for PBXProject "CustomMapStyles" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CustomMapStyles" */ = { isa = XCConfigurationList; buildConfigurations = ( - C827C54F23293726003AA0C5 /* Debug */, - C827C55023293726003AA0C5 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "CustomMapStyles" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CustomMapStyles" */ = { 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/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/Contents.json b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 70% rename from examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/Contents.json rename to examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AccentColor.colorset/Contents.json index af98cf01..eb878970 100644 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/Contents.json +++ b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AccentColor.colorset/Contents.json @@ -1,7 +1,6 @@ { - "images" : [ + "colors" : [ { - "filename" : "menu.png", "idiom" : "universal" } ], diff --git a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/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/CustomMapStyles/CustomMapStyles/Base.lproj/LaunchScreen.storyboard b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Base.lproj/Main.storyboard b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Base.lproj/Main.storyboard deleted file mode 100644 index 656a6fdc..00000000 --- a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Base.lproj/Main.storyboard +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/ContentView.swift b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/ContentView.swift new file mode 100644 index 00000000..93eef7e3 --- /dev/null +++ b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/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 customMapStylesExample: CustomMapStylesExample? + + 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: "Load") { + customMapStylesExample?.onLoadButtonClicked() + } + CustomButton(title: "Unload") { + customMapStylesExample?.onUnloadButtonClicked() + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + customMapStylesExample = CustomMapStylesExample(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/CustomMapStyles/CustomMapStyles/CustomMapStylesApp.swift b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesApp.swift new file mode 100644 index 00000000..9e373dec --- /dev/null +++ b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesApp.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 CustomMapStylesApp: 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/CustomMapStyles/CustomMapStyles/CustomMapStylesExample.swift b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesExample.swift index 27f8ed9d..24896dcb 100644 --- a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesExample.swift +++ b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesExample.swift @@ -22,19 +22,28 @@ import UIKit class CustomMapStylesExample { - private let viewController: UIViewController private let mapView: MapView - 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: 200 * 1000) camera.lookAt(point: GeoCoordinates(latitude: 52.518043, longitude: 13.405991), zoom: distanceInMeters) + + // Load the initial 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))") + } + } + func onLoadButtonClicked() { loadCustomMapStyle() } @@ -45,28 +54,35 @@ class CustomMapStylesExample { // Drag & drop the assets folder including the JSON style onto Xcode's project navigator. private func loadCustomMapStyle() { - let jsonResourceString = getResourceStringFromBundle(name: "custom-dark-style-neon-rds", + let jsonResourceString = getResourceStringFromBundle(filename: "custom-dark-style-neon-rds", type: "json") // Load the map scene using the path to the JSON resource. mapView.mapScene.loadScene(fromFile: jsonResourceString, completion: onLoadScene) } - private func getResourceStringFromBundle(name: String, type: String) -> String { - let bundle = Bundle(for: ViewController.self) - let resourceUrl = bundle.url(forResource: name, - withExtension: type) - guard let resourceString = resourceUrl?.path else { + private func getResourceStringFromBundle(filename: String, type: String) -> String { + let bundle = Bundle.main + guard let resourceUrl = bundle.url(forResource: filename, withExtension: type) else { fatalError("Error: Resource not found!") } - return resourceString + return resourceUrl.path } - // Completion handler when loading a map scene. - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return + 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/CustomMapStyles/CustomMapStyles/Info.plist b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/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/CustomMapStyles/CustomMapStyles/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/ViewController.swift b/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/ViewController.swift deleted file mode 100644 index 982e7dcc..00000000 --- a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/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 customMapStylesExample: CustomMapStylesExample! - 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. - customMapStylesExample = CustomMapStylesExample(viewController: self, mapView: mapView) - isMapSceneLoaded = true - } - - @IBAction func onLoadButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - customMapStylesExample.onLoadButtonClicked() - } - } - - @IBAction func onUnloadButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - customMapStylesExample.onUnloadButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers.xcodeproj/project.pbxproj b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers.xcodeproj/project.pbxproj index feae1ef2..4d51f22b 100644 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; 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 */; }; - C8553C4D25B2294800E95722 /* CustomRasterLayersExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8553C4C25B2294800E95722 /* CustomRasterLayersExample.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, ); }; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837D12C20EFA70004F54E /* CustomRasterLayersExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* CustomRasterLayersExample.swift */; }; + 86D2C6FB2CCBA2BA0060CAA8 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86D2C6FA2CCBA2B30060CAA8 /* ContentView.swift */; }; + 86D2C6FF2CCBA3240060CAA8 /* CustomRasterLayersApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86D2C6FE2CCBA3180060CAA8 /* CustomRasterLayersApp.swift */; }; + 86F767F92CCBC58B006A22E8 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86F767F82CCBC58B006A22E8 /* heresdk.xcframework */; }; + 86F767FA2CCBC5AE006A22E8 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 86F767F82CCBC58B006A22E8 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* 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 */, + 86F767FA2CCBC5AE006A22E8 /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,64 +31,68 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C827C53F2329371C003AA0C5 /* CustomRasterLayers.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomRasterLayers.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 = ""; }; - C8553C4C25B2294800E95722 /* CustomRasterLayersExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRasterLayersExample.swift; sourceTree = ""; }; - C88C019123CDFDD500043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* CustomRasterLayers.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomRasterLayers.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = ""; }; + 83C837D02C20EFA70004F54E /* CustomRasterLayersExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRasterLayersExample.swift; sourceTree = ""; }; + 86D2C6FA2CCBA2B30060CAA8 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 86D2C6FE2CCBA3180060CAA8 /* CustomRasterLayersApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRasterLayersApp.swift; sourceTree = ""; }; + 86F767F82CCBC58B006A22E8 /* heresdk.xcframework */ = {isa = PBXFileReference; expectedSignature = ""; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C827C53C2329371C003AA0C5 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C019223CDFDD600043918 /* heresdk.xcframework in Frameworks */, + 86F767F92CCBC58B006A22E8 /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C827C5362329371C003AA0C5 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C827C5412329371C003AA0C5 /* CustomRasterLayers */, - C827C5402329371C003AA0C5 /* Products */, - C88C019023CDFDD400043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* CustomRasterLayers */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C827C5402329371C003AA0C5 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C827C53F2329371C003AA0C5 /* CustomRasterLayers.app */, + 83C837B82C207F340004F54E /* CustomRasterLayers.app */, ); name = Products; sourceTree = ""; }; - C827C5412329371C003AA0C5 /* CustomRasterLayers */ = { + 83C837BA2C207F340004F54E /* CustomRasterLayers */ = { isa = PBXGroup; children = ( - C827C5422329371C003AA0C5 /* AppDelegate.swift */, - C827C5442329371C003AA0C5 /* ViewController.swift */, - C8553C4C25B2294800E95722 /* CustomRasterLayersExample.swift */, - C827C5462329371C003AA0C5 /* Main.storyboard */, - C827C54923293725003AA0C5 /* Assets.xcassets */, - C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */, - C827C54E23293726003AA0C5 /* Info.plist */, + 86D2C6FE2CCBA3180060CAA8 /* CustomRasterLayersApp.swift */, + 86D2C6FA2CCBA2B30060CAA8 /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* CustomRasterLayersExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = CustomRasterLayers; 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 = ( + 86F767F82CCBC58B006A22E8 /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -97,14 +100,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C827C53E2329371C003AA0C5 /* CustomRasterLayers */ = { + 83C837B72C207F340004F54E /* CustomRasterLayers */ = { isa = PBXNativeTarget; - buildConfigurationList = C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "CustomRasterLayers" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CustomRasterLayers" */; 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 = CustomRasterLayers; productName = CustomRasterLayers; - productReference = C827C53F2329371C003AA0C5 /* CustomRasterLayers.app */; + productReference = 83C837B82C207F340004F54E /* CustomRasterLayers.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 = 1300; - 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 "CustomRasterLayers" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CustomRasterLayers" */; + 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 /* CustomRasterLayers */, + 83C837B72C207F340004F54E /* CustomRasterLayers */, ); }; /* 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 = ( - C8553C4D25B2294800E95722 /* CustomRasterLayersExample.swift in Sources */, - C827C5452329371C003AA0C5 /* ViewController.swift in Sources */, - C827C5432329371C003AA0C5 /* AppDelegate.swift in Sources */, + 86D2C6FB2CCBA2BA0060CAA8 /* ContentView.swift in Sources */, + 83C837D12C20EFA70004F54E /* CustomRasterLayersExample.swift in Sources */, + 86D2C6FF2CCBA3240060CAA8 /* CustomRasterLayersApp.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; @@ -248,23 +230,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; @@ -304,58 +287,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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 = "\"CustomRasterLayers/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CustomRasterLayers/Info.plist; + 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 = 15.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 = "\"CustomRasterLayers/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CustomRasterLayers/Info.plist; + 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 = 15.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 "CustomRasterLayers" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CustomRasterLayers" */ = { isa = XCConfigurationList; buildConfigurations = ( - C827C54F23293726003AA0C5 /* Debug */, - C827C55023293726003AA0C5 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "CustomRasterLayers" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CustomRasterLayers" */ = { 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/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/Contents.json b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 70% rename from examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/Contents.json rename to examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AccentColor.colorset/Contents.json index af98cf01..eb878970 100644 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/Contents.json +++ b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AccentColor.colorset/Contents.json @@ -1,7 +1,6 @@ { - "images" : [ + "colors" : [ { - "filename" : "menu.png", "idiom" : "universal" } ], diff --git a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/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/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/Contents.json b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/Contents.json +++ b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/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/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/Contents.json b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/Contents.json index 1d8ce251..f46a3fc8 100644 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/Contents.json +++ b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/Contents.json @@ -1,23 +1,21 @@ { "images" : [ { + "filename" : "poi_texture.png", "idiom" : "universal", - "filename" : "poi@1x.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "poi@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "poi@3x.png", "scale" : "3x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@1x.png b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@1x.png deleted file mode 100644 index c288ce06b7b008863543211c557fdc54b4a2d272..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2791 zcmY*bdpr}||3^_YcXCOLl!$F^VK&zxcb3Zvp_xm}uxVSlE9DZ>=1#Tplwv7zzfCNc z;z?5Odq_i~TBAt5)ARhE-}if7ug^K3^EvO&`~CTx*ZJe5ySdnjiYSWk@$re;pFkja z>k*!T_6qT4L}d6g-olSZ+F9|@2bC6i8{w!Er|^7y`=ob_pRc%7o(DJ;=7A!hoSmR( z92OK9ggc7?k+4xbG#?*~1m(F{3?UFm!bU{mp(ME4Zv>R*?}Wi>z~2x;I9v_o>;|;P z#bAJjAOjFY%}fLc1j1s1f}u!+?LXWCMG6eh#pu^ zPlt!l!IL8ifh3(s{Gq=|{*MQN!J}isq6lHQNZ<}{;8|QO0j{RDBlPe1yG}w_@c%1C z;{R!j*C2T31gr~!fdA#@rNVZiP}i6+3{QE7-%J5_M|rK9 ziNL`BUYnVSQdwSS5PH{*B9o%bUOV|4$br+g znmPw%B4-}WtrDj<*QR~OFXA#U7QbF^Wy4fDIItn|Ao-C@1yT!>^hTnRVs6=8cnDG9 z-@%-19a0%W_qX>(5c|t7>FLYmw#Bpkv`)p|bWmTRUZmx%t$AVx>z%29x)>WDs6Cl1NN=zXUPv8%H?yu?M%0JIIO-6IQgzV7mc=BizoFP z8`VrqJf0(qsy(*_9bMD#R@`S$U4k{=m=8&@xi;fQ6;_R#kyAw?G*9m8Ck4}nzYs6D z@1i6_a%uUPzJWVk%O)Hj+{}P@X5xy9B}!pDoop&x13>@yfHT@4PHq%LEzZjJuM6-Y zL%o##h@PuBzjqiCXP~JwU@*OE7TAVgc3f;TH-{@2>$~EFJbJ9f4M{{gl+Vra@)d+C zQ1yjED(!l2OWIl;viw1rkw10f8D{+NVo=!Cod@c0v3n|&JVLJfvEuXdGW zt$e%JyQuTQq0X;uPzN~+>HZh1tHp!Adf`@k(EwEo6Z3a%s-gF1s#1V5mRGAOJ!Nmc zCoZ`gMf~aI=HF0MpKf_Y=7@Z|@ulEKzQd{}2e=A8IX>}<-I%2c7i-&zB%N`9+{kiD zs7G(ICNvl_Ti1XC$c@si>;vNaXJiDkBmqRGFDdETRv7@NEFtIM%_GLAL%b9 z`H6gc>D(v_-~?14gZ2Z^fQ*GbQ4)mX+EV^up)#@Q4olKocM5t2+Tdp=iq2fG(H33N zVrC}kvvMswhg|L#zlR5yGbj>)Ha%0cRwcXaOip!;h=|8+$q^M?n_rdx2tszw<63PU zdC>PU4XUYZ9D^DWP;&8-oY~D(z?;_f;Tveam#Cd;-8fne)ue$njx-1_(l@f|OJZjX zmMA{A6nxkHicDt_HaxC!jf~R8KIazbQFKlOxSb#`zH7+M=?u1?XqGHaZ@$$++MQ*4 z*?n>*N`D%aVHJo}&8mH@lG>u8YAY%04Mc~p2yBOzG#?D$KXT`ERSd--Dz-C#e|A|E zqNK6WwHsk!oX6E)_lJ4yDc>KF!8zgAzrWr>w9$s&5os`H+Zbb(f2>sMu0vp7Pr>Vs z{c(dq^^Wg{Yf`C>PS$4>1z&VE+1o$(wU_KNAcp20kfnN$M!VIy>#I9ghx2~1 z;iry|*=1tSgdq3I*U2C3_f!KvMOo+*S4&?w<4fV9V3H(^P0M}a_aZAg8zu<9{KHB9 zFm@n0**{D&U^eBO!tAHXrlAGXP4HjFKNnbM9n};yID&jZyvKc58p}9>mA1AO^H%zm zFG1FUTpU`aq<)`gbPYFc-?QAUuVXRde4xgrB-nLk9U>K~-AQ>pNIUHdRRr#XK9 zkQM+w8EoEu(flp;l(N|fmi&ETD5bvMj^6_f{IEQgsqvYS>d>~alz@K;_jlv4r*_*W zoIEqLu3qh=p3)^JWwlVay2W<;b9^JVhGlxF%i{b86k;s*!rDwu1jMC$iHQ>vlc9Lj zp$!kiE2W#i7*1n5;)8YtwHjY~95;$q`l|r)^<`pncy}0TBP32U(fQ4b$}~2tE^Zq2 zjBqo}(yjj06z6vA_ul4j(;*l1ZhbvI`INbLWh~?qYtvMy><`&QWd38zH!rSr`njU+ ze73pe!u?jVZ8kRhYj$xx)UodAeDdt++CKB>d6{=ldhqp;Sh0Mtsl;)^(X;xb-XAYkB~&D{CwuWu%f4178J3KbY|(*;XqCj)AU6+cHM%K7pCwV~iWro>b ztmmHjdFkD{B#{op+MGkp`Q}^q>4cmfCVD6~R!1DJViE$r+667gmmfvD{9prQ>l
)24N6ykpz1;oO<6R~2)s?ZTtN6NdiZ(eV$ZV{5g{ n$T(}{-l=zw)Zc)-;UPPQ6s{q#|HoaL>lVK1`ngwL%hJne(1j|8dg6HXr2aY zN`R_i#+`=+o}0R zmGQ8%moiXR{ZIMBN|xQx%gap)2t*(d0tgWSxQ7E!NK#S~C@2gR7Uq9I@O%2XdRhDO zyLxi`o8*6Zl%bxs9!_pvPHRpXLEzsf zKp_D^;D5OvN@f0LrF1=i>Xyl8wY2oL_q~d>cnCYjR{@C=Cjm4yaF%S)#JiUvvZ+@8bLvlaZ zPb0jjp%#bl8G2r4Z)9wETy-fHAs(7mX5xH>VT#2EJG^?m5TVjXuN0u^;XRf*Y;=$I zF4#=R1CaJo9abX@dpmV!XR30JQ_}XufA)_4oX=Rjy7j(HrcBN)EGbPY0Y`JF)k*k{ zGSCq0&6uyhK^<1 z7bY4+D=WP<8Kl6%GNYskSf6*XsIk{}#{GgrY_h(s&))!_c_N;8m^et$LBaW z44)>V49|zd8`Sv{`wu+BB2=5?+ZPPU&aXA84Ouc8Op4N4Z~~qs=J!;=HdL zDQ~3ts@S&1_9wr2`~^ji_%z~I6l3EwF{?02MKpxSKJdu0?`}PYsz3fV9Bw{PWDA_a z!a|-+8nC@IckENb!D=AiKTgdQO^E=m(2T1bX&1eb2{MbS%AsCs?l8c+q-o!}Q*%b0 zSw%@7X=UUqHckQDAWxy=L#KaO4{Hm_sX6rMd>&gON7+{p_v#WC{uV|}O6lpnJt^#Y zw(%jDm5@N(p(-9W zUp;xy_RH?dL|#wn4bzgK&`Nw*8fDHWJ9cg(L_%Vp`Mfgx^y7~&x!&S1|Cz+1Y=&W< zoJ!AqE2ZgPOB=Ugg>v+%&wjpD9Pb!Ztd|?l2kF9torGFG9H12f7*{?ivS?Y`%wRI8 z5_y5>6`qMhOARfQ#2S5Ka+bH2*7N(mFCk_=XbSrc)q-gg@E$cRG9j)eDf`@mA#WIC_BgK+b|XM;T}ZPrX-I2UQBPzDq`>hEzI6=5fD@vW^=jL247yH zZoa{97z-*Aav;`vKlBz(e&)hFaoQ?ZVO6tcBLpQKo;4Zq)30aKrp@5Hk@l=+rWwS;c|S=6ySClXNJ6EasYVhD(#^^`FG!5f z!c62%x|f?hTlx6?zJD$=s-|JC>sQUr`yE$+()d9?FVV!#EY2-QloxOj=M9!m9MR!O zCbymb8u5<{i$&-Rp&~=l{g??w!FmfTNsg50o{g^c<^GQ0?naAT zM(XDxG1nX5#-}0&zHiYIwX33U_j=)Qq_po|JJ$wq7CIFiItut}@TwMhmtv)n`fuS2#$hHTL?q0+F=u=!=EmBXMuj9T}zsk={4lBad-MAxVQJ zJG?x&N?WNuR$Kg>&*+l{1LPrj2lHP(8O@)X-<=8je&>`zK|^>uU(3mbtpxjJCN|vi zpWNh(cQsV72nvL<^|Z9k?2fOOk1yX8!CKKXP%F`Zmzl#cYyi{1=M^V|^hm)tqK?QA z_qNgR8)TEH7J*#+1ErTPI}`bxiRq&kU8?dvwK43J2&c}k6u|0{F8rhvL(+YDYQ6+>koO_ zc^4PF^*KR1x^yp$pagW_Ad#K@tbT)UjM~jcLOhJpIZdrv;ohpMN%N&;ur`4DWn=

Y4&!YigM*ewcaQv=@V5&N*JZpniYyUSBM08H+92vvQcFG zRs@i3A@wc|%c2f9^F&2MBYIb3aFgGr2Q^p*I(`vS6yz3i{uP%z8mw@<;cBqo^s>DP zFHD3C7u~z+y9~C8-B%~Y)SZ6qk1Fqz1hpcfR4lXTMRU{Daj_#9Kq+ms7Vjchwy||R zuZM4+^#wKgUx)YFk151cRU{^miaOIDFyq8fkBSBqbZa%=*x7#9`(O}5WD22j6cwvu zD>LhnBdGR>r#;E->R(Fnt;_G8<(n_7ah!%+YtyA{vYz}HG@U(3!FMDXmKbxH41H7& z;~+07!xX<|!wRv!%=MYnV*ME)sasK+Kq%2*VxVK}WuwWsA4rDAkDCI3am3|iZHPnA zRmudVA1O*HM3sLt*c@xZ=Dr!!-rN`F7d#_aixLp9Kl8DXGy1W_K3evM&I$YAN$caL zAqvanE*?NdWn4_nt#3f@&N zzat){rAhL(SkIB@=2G@4B-fd$=}_?IrDcv8aMh@E$AZux84eJ!ISLuO;w&(KQ?uM~ ze+|Za3a8?aHc0P9_(P$z6ruJwb4%!}MLQfS_1CN4M%cxiaO6u`KX!%-X5T7oQVThI z^P2T{NA;F``($BJe6BPSMEa?~^1U!1D%pL!R`IW@9rtD)G)xQ+VBRn|#r>IVZSKde zU3%uvP;9pMx4A(!&LpyzHDLN-!V>M+7m3q^ql12kK|9LCMjIbf?oo8t*bIKuJLc_m0~@#Zd|m=DA{UcxKHO3kI~Z7XL=;)7Kab`M>b zThs!tem^A+Fcz?k_VuwNGoBuxmSV_Pjf&96(J7Q1`Q^nWqI^5Hb4Ln-O&7i?`T2;W zN@J#W`F@qZvC^A}`l;4;s$rf)Lb2iVr~~Qcv?T}dd#IQfNrMd~_hg+tX>MGp0q_3z zw(XpCB({k7iyu40OKMfv_|oPEIvtxYOKo<3_!ozZS6hY#tTSXr1~k zlj60;+#5C`mIX9p_*u1HlM~sL#Jn+eqR1Ff`!?A1HBmn@B88XUYaXsvjPJD~ku&BE zu}q7Jl8b zK45XU13Sm7qeI+wm_Q$rQVO^`kjsUk;VrRY3O>xo?9>lFl9_QaIx~c__oofzlj4Sm zgl8$JcS@M1{SN zf4Kk&rU~+5gG_>AC({KrqGF#M)LS`LLuCmhc6}g zQ#1l5)7T8D9q<5Z#E?CS@TPX~UHUizWs#^a78qX=*E$s&8(QF;!euxaY9Soh&Cz~5 zbmQ%^yUzgDP14!NW+v#}$OA+|1rBvrocHv~>TmTCeHbI}t9}&BeJe~tTLosaKEC&w z1~<{&SL*nf>Y1Yw)4^d{$IX1#e#m>yfq_H$bhiQqBqV-EGC|HC)Us86mtRKrTY>u` zG$-a*oqk7w&MRV~9?U_@iTlkdki`@$flH$Y9%k~+=iSD9oy#h|yij2^^yeGV^H1gYd zL%-)@)>gqEP0dy>{r7wAxuv9-5#{Aa%p@j*0fz!~-At;YZrNp3%d9$Cs63?};piwQ zQfUHDOW$0l>Z=V^AKMt^ESC|}YGHOVTkF8U0*hW<>Q&a?F4MbHn>pC#E4i9uGf2MZ${GUfWbI=kO75PDeMeDMWNA zB%C{854{5XSW0K#v%GOp=VB;ILT5;L^EizO!k3LV&k$)@3$DzmGPu*Uh&pFwSV9Im z&zpY08j>O&+T9MEUuxO>qq@xp8c69ezX(a{Ru~PouQbEbp5Tqu=5Qn=s0q;7C8+0N z|_vm@>jGINNg{Ur+_PviI9fr(;2ML^_ck-2Q{9`@QU1$xRW|>|2~}4_TUOXKN!o|N z;iV=agX$;qvs>>5Wpk7{1`eY!13W&sCF?3qJc<>D(@kDM(eWUmGOgCaC!)Ji6%6*L zv~dyPAi}Xa?=Ng<_vG^11pxddWzJQzKFs4OZP}?qCIRM5Z*8YM-o+xOTwtlpD zYy`hk(@(eMgP1)NH;8p>_232|Mp!87I z3+gXjI>&9f1PiZ=UjB`W@d!7iXFAQx zrJJyquGdMOBuEOr8;a1|>kr~bKuVF%Hq1UF$n0TpoLW1xDfsn#F2|{@1T^*Rxmu9! zkt{<8hMUnH2gwog+1Az`d*8b@fxCooXPGI>OV5zBn9}Fq*<3{D+ktZMYDqUEh7#dN zznrwn-1l)P|6V1Wa=ENKx4k4xh*jVmnl0}@m{Y2RQF&98!JAYsweQy$3hH?KPt{wh z;N`A^`1Ahr48Fdz1^@s6b{rlF00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru;RzWC8!V(S?jisH5_d^N zK~#9!?VWjW9Mzr2zrWYrbL$uh%aUzu%Lg_`k%Xi|FdI@_#uzYLwF%k4)>bxQ6IC`WXq>6%Nj{DqnYXM_kR1w7#U+r z)-gwq+`lSSscL%Wb^kv7{r!ILb-(wBnc-UDn{Zv=f^^M6rWfjoQ+=)1u%^#cWS>pU zXOU9VVXMI-U63O*@4fe)tw1*t^Bgcw2eSqtz`;QJ&*ufa9I;0*EAtb~52P0sJPlV#TK}$ibe_nl+WWlsAy#9{_Y7 z2*kkvxF`q?1;N2UT6NhpW>CBr6pMqR@ibUwKo>h$XiwRJz^}QcX1@#a1m;=2`dei4 zzcKg^m6rmVhJr9DAr5yzw08iO1!&?!29{VWR=jpffTX&$6^7Sd55?by;Ss9xG^p}$ z_VZpA^Qkx-foSajEQ{G^JZszDpYkmWn@1%`0!XZTV7Zn`+ytpkASW?kH4_a;~Ks#R*#fTVTn#v2LqDL~EQP!Q_$@s7=bnaH7H|3OeJ4ruzj zmM*@>H{ZOs;6dv5-S_vxG#`Nw<#NI}a9Jr%1*5}V&%Km zp(a$Nhs#byQwrih3&i0FAjCE+mAr~qt?F?+NV@BRv4%+eFPP4ir;h`dm%=rqyDIye z0UXEz< z&m}gHzYU*C7z=#TLO6l=?Mn@09$@jP8bwh1!=5Z ze+g2l@2N56;Nl|J`I(Ne#UZFM8>EOQmO;ugHP%&QURBAmRCv9M zhYeCQlRsv^&wa9y=RpGY`=BL~Hx3J=v3}!)kZLlQm$}}|H_Y;~^w8ag4YP&}l9c%` zAc6`PyPnK_ckFRWkFo0 zXlaLNJH(c!tb%X;NymVpRpahCU?vU~M&I$es&UwP(IvQR#+ieL2mloxFYcLfCbnO6 zF}_<_7!LzD6abh>^Q5jgX^s>YUknnCACe;gtESJu<6r$c#`}hUuBZF_c=BuCz}+*> zgmC!u_w>><0>ZK`K6#E*@_Y{X96b$A5aF?}oQLbG#%1iLSTSW9Ci?@p;o}dWoSHj@ z0QFyNhpRFO*!Hw9_a~2)T{tim z%pN#+e*bk<Ms!a9p_OSS0I=7Yid-^z3QqTB|1E{_J|7lNs&=j-0g%lz`v{$W^HRE?hRGe&R@Ntk;VR zO2ZE9cM;fY0E(v!)Q>E6>eG&SV=GUIHV0+84k%SRfFhOOsV^VT%7Z#)IZ=^E`jY?$ z`Ufc~;M9SDDS_NCE-^LW&;>0t0Wkaf2TAN_;ml#Gl01a`QiskqV<7;hz(6_D58=-1 zaJ&f(fbtJiwff*tMRwbE&fDy=EQf+59Nh-v#EN9VnFGeVdgD27voQ~C4l=j`bS$VZ zX{3+~?4khR~xqj4wxGY^H;pbMR33Sb69 zeb_HZjgs%AZ~dgB2R44$umexFWPX2?Ct41ou5qWMubmR{)xTW@XXKeVQIjro}32{_#tKwZNQ zT=(I7*qaPzd&i))vfo zbt_hE{|s%Z!S^%UQYqZB{WHvbZL6bm;xT3`P;UYZaok2~`thR%@{b^K8%3k(v>+$0_%^4xysJ~<{lK~0FsD;b4XFZ zpq>~A{AWJFx^v>hRiXVDY#S7fxejznSnY`dwhfu+ef&h9pAe+IYSoJ*xltVIbUo-0 z6CDwdR6Fdu?s{d=Aeot!;KwK$OK&^tT7J#4K+zbKM*q(JEa%zpD|2>l?9;*$iw{}({FCQ^UgL(Sx<_NPR9_y{;|^F> z!p)U=RO6w;fN3Q~^PzhOJZ_*56Thx+BB`Dh?S~3xq-Ru_tsvSvK+=9P`N)Hf!v+Ze z6id~?mML+l!*y(~)!2Rruw{zkvD;62?8y#DuD*R2F+VO29d;|&99OEMqZ6dmW69O4 zca0b%0C@N9{TVE)UEAN{IygtB?Qa1r`;e#mz{)|XcQ6O_Jp6D6K)<5y9#B`0>*XvP zMY=)VJpjvJM%O&lKB(^uc9SzABIEWu--5?D-#+t9?}gkWaZoTDhS%9?QeGU+ja#9F_nULpcxS2ZJVuM4f*@S*$9+2 zZys+%x;|mACoE@7b@Xy)1!2t4cI*Nr%q~mAS9ryWeM1h(!)kZ_{DaEx`w1mYrR{g~ z<%qi)`woJVDX9Y99}frOut5TVy=2MLY-p>gvkRi_kV|8@#Z7BFsIv!W&7fG^ zr88KFu{gB72LWCGi(OoF-H3mWGw^~HZQ4|6M5FJ3Xri1}4febHXbtGEL=swK6PW3s z9W4JQFZ|Jn3yqAFn_N@VYWaM#p}1XZYyu^cF0GS5gj8*|&vR)eAZ83C0Py0)J1oEN zB35YC8k<19F3f%*Dn3L({W4y>ct^&5n=}0GDsA3yj^34gg#^moF#83+Bu!`yy8-41 zLcz<-n{N6bqt$Q5`?m9I|7w>MUBXPAT4PgsKA#IQ4N-CzihY-78e&#J0st>q@E0mF zE`{Vyt>M&$NlEiaPL$m!3C%Va)V`mU{%E!?z^qyF5z0ez!Q6eS!aN3Ipy&#-rsmzO zwZ&PU-{E=Wp>Lt1=XnTGET>mHcD?kBJ2sVq*02YVGRDE;xz?fuuV=HptdDk^H!gUa zi;J#=QqfaInMWb2IF}S(oo$FY0SN$BP0gEJ8k`44e6+(nMu{awS6K@dyqb%4bN2kn zn!oTBE(*>$s!VfqE3vfXnp{E5Daa$r+{VR4bD>mJYit6gMvpSdG@&)@1*D8~Y4O$8 z{Q0lsvi+Pt5$=O2WmId}Gdf^e7DU4yK-zIGF1jYy5c2}^c$j+&8>VGJ+t~!Nk3g)c zc{wi;f%7=M+^DbrHpS!50-^{S72H&JCIS?LnByD@&a)OS+?u!0&UtoTA55kqCV&cM z3ZD?^8;=m@P$;hu^A=iE)k5n@3qvQL>0 zK6oB_VlMz(#w0*W4pWH)0s)LJXvUT1Ez906M1K_QoN@D}n?68s=yHHMiPfq#DtzR_n0}q_b@x)6YIt_%rWxS7uQ;xtFnr$u}JrGBg zB9AKbcYo7&HOzx$wS$pXrVtW-|KwT+W<21^~3}yZT+8i-@i6 z_NM0w*$;ZbhZMm(AjMfHQsl`1_9;^1?QUpwN{+OOCPUb#5kwKdbkfU)ibClfK_j}y z&5=&LAi7vDE^aKgJ(|}mHACv;0RYWrGo?vOH)X1)XIc;Q%eGs!y5>0he>`a8gMG~? Qy#N3J07*qoM6N<$g1>e)?*IS* diff --git a/examples/latest/explore/ios/CustomRasterLayers/assets/poi_texture.png b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi_texture.png similarity index 100% rename from examples/latest/explore/ios/CustomRasterLayers/assets/poi_texture.png rename to examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi_texture.png diff --git a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/LaunchScreen.storyboard b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/Main.storyboard b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/Main.storyboard deleted file mode 100644 index 630a1228..00000000 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/Main.storyboard +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/ContentView.swift b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/ContentView.swift new file mode 100644 index 00000000..39817d7f --- /dev/null +++ b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/ContentView.swift @@ -0,0 +1,83 @@ +/* + * Copyright (C) 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 customRasterLayersExample: CustomRasterLayersExample? + + 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: "Enable") { + customRasterLayersExample?.onEnableButtonClicked() + }.padding(.trailing, 20) + CustomButton(title: "Disable") { + customRasterLayersExample?.onDisableButtonClicked() + }.padding(.leading, 20) + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + customRasterLayersExample = CustomRasterLayersExample(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/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersApp.swift b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersApp.swift new file mode 100644 index 00000000..16b403dc --- /dev/null +++ b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersApp.swift @@ -0,0 +1,72 @@ +/* + * 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 CustomRasterLayersApp: 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/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift index 554290e2..9cae5f94 100644 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift +++ b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift @@ -1,7 +1,7 @@ /* * Copyright (C) 2019-2024 HERE Europe B.V. * - * Licensed under the Apache License, Version 2.0 (the "License") + * 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 * @@ -18,7 +18,7 @@ */ import heresdk -import UIKit +import SwiftUI class CustomRasterLayersExample { @@ -26,13 +26,20 @@ class CustomRasterLayersExample { private var rasterMapLayerStyle: MapLayer! private var rasterDataSourceStyle: RasterDataSource! - init(mapView: MapView) { + init(_ mapView: MapView) { self.mapView = mapView + // Configure the map. let camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: 60 * 1000) camera.lookAt(point: GeoCoordinates(latitude: 52.518043, longitude: 13.405991), zoom: distanceInMeters) + + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) + + 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) let dataSourceName = "myRasterDataSourceStyle" rasterDataSourceStyle = createRasterDataSource(dataSourceName: dataSourceName) @@ -44,6 +51,13 @@ class CustomRasterLayersExample { // Add a POI marker addPOIMapMarker(geoCoordinates: GeoCoordinates(latitude: 52.530932, longitude: 13.384915)) } + + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } func onEnableButtonClicked() { rasterMapLayerStyle.setEnabled(true) @@ -132,4 +146,21 @@ class CustomRasterLayersExample { mapView.mapScene.addMapMarker(mapMarker) } + + 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/CustomRasterLayers/CustomRasterLayers/Info.plist b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/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/CustomRasterLayers/CustomRasterLayers/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/ViewController.swift b/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/ViewController.swift deleted file mode 100644 index 8b354998..00000000 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/ViewController.swift +++ /dev/null @@ -1,78 +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 customRasterLayersExample: CustomRasterLayersExample! - 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) - } - - 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) - } - - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - // Start the example. - customRasterLayersExample = CustomRasterLayersExample(mapView: mapView) - isMapSceneLoaded = true - } - - @IBAction func onEnableButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - customRasterLayersExample.onEnableButtonClicked() - } - } - - @IBAction func onDisableButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - customRasterLayersExample.onDisableButtonClicked() - } - } - - func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - - alertController.addAction(UIAlertAction(title: "Ok", style: .cancel, handler: nil)) - - present(alertController, animated: true, completion: nil) - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/explore/ios/CustomRasterLayers/README.md b/examples/latest/explore/ios/CustomRasterLayers/README.md index 20ff3457..429588bb 100644 --- a/examples/latest/explore/ios/CustomRasterLayers/README.md +++ b/examples/latest/explore/ios/CustomRasterLayers/README.md @@ -1,4 +1,4 @@ -This example app shows how to load custom raster layers. You can find how this is done in [CustomRasterLayersExample.swift](CustomRasterLayersExample/CustomRasterLayersExample.swift). +The CustomRasterLayers example app shows how to calculate a route from A to B with a number of waypoints in between that is visualized on the map. You can find how this is done in [CustomRasterLayersExample.swift](CustomRasterLayers/CustomRasterLayersExample.swift). Build instructions: ------------------- diff --git a/examples/latest/explore/ios/EVRouting/EVRouting/RoutingExample.swift b/examples/latest/explore/ios/EVRouting/EVRouting/RoutingExample.swift index ef67a4db..ef9a40a0 100644 --- a/examples/latest/explore/ios/EVRouting/EVRouting/RoutingExample.swift +++ b/examples/latest/explore/ios/EVRouting/EVRouting/RoutingExample.swift @@ -235,7 +235,7 @@ class RoutingExample { let searchOptions = SearchOptions(languageCode: LanguageCode.enUs, maxItems: 30) - searchEngine.search(textQuery: textQuery, + searchEngine.searchByText(textQuery, options: searchOptions, completion: onSearchCompleted) } diff --git a/examples/latest/explore/ios/Gestures/Gestures.xcodeproj/project.pbxproj b/examples/latest/explore/ios/Gestures/Gestures.xcodeproj/project.pbxproj index 08464c8f..0d69acb0 100644 --- a/examples/latest/explore/ios/Gestures/Gestures.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/Gestures/Gestures.xcodeproj/project.pbxproj @@ -3,29 +3,28 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - C865247F20B81A8900392D48 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C865247E20B81A8900392D48 /* AppDelegate.swift */; }; - C865248120B81A8900392D48 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C865248020B81A8900392D48 /* ViewController.swift */; }; - C865248420B81A8900392D48 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C865248220B81A8900392D48 /* Main.storyboard */; }; - C865248620B81A8B00392D48 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C865248520B81A8B00392D48 /* Assets.xcassets */; }; - C865248920B81A8B00392D48 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C865248720B81A8B00392D48 /* LaunchScreen.storyboard */; }; - C865249520B83D7600392D48 /* GesturesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C865249420B83D7600392D48 /* GesturesExample.swift */; }; - C88C016523CDFC6400043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C016423CDFC6400043918 /* heresdk.xcframework */; }; - C88C016623CDFC6400043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C016423CDFC6400043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - C8EAA7D423F32DF20013DDA9 /* GestureMapAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8EAA7D323F32DF20013DDA9 /* GestureMapAnimator.swift */; }; + 830C4ABB2CBFEDA000B4252B /* GestureMapAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830C4ABA2CBFEDA000B4252B /* GestureMapAnimator.swift */; }; + 83C837BC2C207F340004F54E /* GesturesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* GesturesApp.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 /* GesturesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* GesturesExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C88C016723CDFC6400043918 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C016623CDFC6400043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -33,66 +32,70 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C865247B20B81A8900392D48 /* Gestures.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Gestures.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C865247E20B81A8900392D48 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C865248020B81A8900392D48 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C865248320B81A8900392D48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C865248520B81A8B00392D48 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C865248820B81A8B00392D48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C865248A20B81A8B00392D48 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C865249420B83D7600392D48 /* GesturesExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GesturesExample.swift; sourceTree = ""; }; - C88C016423CDFC6400043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; - C8EAA7D323F32DF20013DDA9 /* GestureMapAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GestureMapAnimator.swift; sourceTree = ""; }; + 830C4ABA2CBFEDA000B4252B /* GestureMapAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GestureMapAnimator.swift; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Gestures.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Gestures.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* GesturesApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GesturesApp.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 /* GesturesExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GesturesExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C865247820B81A8900392D48 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C016523CDFC6400043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C865247220B81A8900392D48 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C865247D20B81A8900392D48 /* Gestures */, - C865247C20B81A8900392D48 /* Products */, - C88C016323CDFC6400043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* Gestures */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C865247C20B81A8900392D48 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C865247B20B81A8900392D48 /* Gestures.app */, + 83C837B82C207F340004F54E /* Gestures.app */, ); name = Products; sourceTree = ""; }; - C865247D20B81A8900392D48 /* Gestures */ = { + 83C837BA2C207F340004F54E /* Gestures */ = { isa = PBXGroup; children = ( - C865247E20B81A8900392D48 /* AppDelegate.swift */, - C865248020B81A8900392D48 /* ViewController.swift */, - C865249420B83D7600392D48 /* GesturesExample.swift */, - C8EAA7D323F32DF20013DDA9 /* GestureMapAnimator.swift */, - C865248220B81A8900392D48 /* Main.storyboard */, - C865248520B81A8B00392D48 /* Assets.xcassets */, - C865248720B81A8B00392D48 /* LaunchScreen.storyboard */, - C865248A20B81A8B00392D48 /* Info.plist */, + 83C837BB2C207F340004F54E /* GesturesApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* GesturesExample.swift */, + 830C4ABA2CBFEDA000B4252B /* GestureMapAnimator.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = Gestures; sourceTree = ""; }; - C88C016323CDFC6400043918 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C88C016423CDFC6400043918 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -100,14 +103,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C865247A20B81A8900392D48 /* Gestures */ = { + 83C837B72C207F340004F54E /* Gestures */ = { isa = PBXNativeTarget; - buildConfigurationList = C865248D20B81A8B00392D48 /* Build configuration list for PBXNativeTarget "Gestures" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Gestures" */; buildPhases = ( - C865247720B81A8900392D48 /* Sources */, - C865247820B81A8900392D48 /* Frameworks */, - C865247920B81A8900392D48 /* Resources */, - C88C016723CDFC6400043918 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -115,99 +118,77 @@ ); name = Gestures; productName = Gestures; - productReference = C865247B20B81A8900392D48 /* Gestures.app */; + productReference = 83C837B82C207F340004F54E /* Gestures.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C865247320B81A8900392D48 /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0930; - LastUpgradeCheck = 0930; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C865247A20B81A8900392D48 = { - CreatedOnToolsVersion = 9.3; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C865247620B81A8900392D48 /* Build configuration list for PBXProject "Gestures" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Gestures" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C865247220B81A8900392D48; - productRefGroup = C865247C20B81A8900392D48 /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C865247A20B81A8900392D48 /* Gestures */, + 83C837B72C207F340004F54E /* Gestures */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C865247920B81A8900392D48 /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C865248920B81A8B00392D48 /* LaunchScreen.storyboard in Resources */, - C865248620B81A8B00392D48 /* Assets.xcassets in Resources */, - C865248420B81A8900392D48 /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C865247720B81A8900392D48 /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C865248120B81A8900392D48 /* ViewController.swift in Sources */, - C865249520B83D7600392D48 /* GesturesExample.swift in Sources */, - C865247F20B81A8900392D48 /* AppDelegate.swift in Sources */, - C8EAA7D423F32DF20013DDA9 /* GestureMapAnimator.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* GesturesApp.swift in Sources */, + 830C4ABB2CBFEDA000B4252B /* GestureMapAnimator.swift in Sources */, + 83C837D12C20EFA70004F54E /* GesturesExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C865248220B81A8900392D48 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C865248320B81A8900392D48 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C865248720B81A8B00392D48 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C865248820B81A8B00392D48 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C865248B20B81A8B00392D48 /* 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; @@ -226,18 +207,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; @@ -252,22 +234,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.0; - MTL_ENABLE_DEBUG_INFO = YES; + 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; }; - C865248C20B81A8B00392D48 /* 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; @@ -286,18 +270,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; @@ -306,58 +291,71 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - C865248E20B81A8B00392D48 /* 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 = "\"Gestures/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Gestures/Info.plist; + 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 = 15.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; }; - C865248F20B81A8B00392D48 /* 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 = "\"Gestures/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Gestures/Info.plist; + 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 = 15.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_VERSION = 5.12.; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -365,25 +363,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C865247620B81A8900392D48 /* Build configuration list for PBXProject "Gestures" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Gestures" */ = { isa = XCConfigurationList; buildConfigurations = ( - C865248B20B81A8B00392D48 /* Debug */, - C865248C20B81A8B00392D48 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C865248D20B81A8B00392D48 /* Build configuration list for PBXNativeTarget "Gestures" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Gestures" */ = { isa = XCConfigurationList; buildConfigurations = ( - C865248E20B81A8B00392D48 /* Debug */, - C865248F20B81A8B00392D48 /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C865247320B81A8900392D48 /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/explore/ios/Gestures/Gestures/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/explore/ios/Gestures/Gestures/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/explore/ios/Gestures/Gestures/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/Gestures/Gestures/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/explore/ios/Gestures/Gestures/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/explore/ios/Gestures/Gestures/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/explore/ios/Gestures/Gestures/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/Gestures/Gestures/Assets.xcassets/Contents.json b/examples/latest/explore/ios/Gestures/Gestures/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/explore/ios/Gestures/Gestures/Assets.xcassets/Contents.json +++ b/examples/latest/explore/ios/Gestures/Gestures/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/Gestures/Gestures/Base.lproj/LaunchScreen.storyboard b/examples/latest/explore/ios/Gestures/Gestures/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f83f6fd5..00000000 --- a/examples/latest/explore/ios/Gestures/Gestures/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Gestures/Gestures/Base.lproj/Main.storyboard b/examples/latest/explore/ios/Gestures/Gestures/Base.lproj/Main.storyboard deleted file mode 100644 index 03c13c22..00000000 --- a/examples/latest/explore/ios/Gestures/Gestures/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Gestures/Gestures/ContentView.swift b/examples/latest/explore/ios/Gestures/Gestures/ContentView.swift new file mode 100644 index 00000000..ddec42d1 --- /dev/null +++ b/examples/latest/explore/ios/Gestures/Gestures/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 gesturesExample: GesturesExample? + + 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. + gesturesExample = GesturesExample(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/explore/ios/CustomRasterLayers/CustomRasterLayers/AppDelegate.swift b/examples/latest/explore/ios/Gestures/Gestures/GesturesApp.swift similarity index 63% rename from examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/AppDelegate.swift rename to examples/latest/explore/ios/Gestures/Gestures/GesturesApp.swift index 5c8c8eef..30ab2420 100644 --- a/examples/latest/explore/ios/CustomRasterLayers/CustomRasterLayers/AppDelegate.swift +++ b/examples/latest/explore/ios/Gestures/Gestures/GesturesApp.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 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() - - 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/Gestures/Gestures/GesturesExample.swift b/examples/latest/explore/ios/Gestures/Gestures/GesturesExample.swift index fa642399..3e72bcfb 100644 --- a/examples/latest/explore/ios/Gestures/Gestures/GesturesExample.swift +++ b/examples/latest/explore/ios/Gestures/Gestures/GesturesExample.swift @@ -25,15 +25,14 @@ class GesturesExample: TapDelegate, TwoFingerTapDelegate, LongPressDelegate { - private var viewController: UIViewController private var mapView: MapView private lazy var gestureMapAnimator = GestureMapAnimator(mapView.camera) - 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), @@ -49,9 +48,19 @@ class GesturesExample: TapDelegate, mapView.gestures.disableDefaultAction(forGesture: .doubleTap) mapView.gestures.disableDefaultAction(forGesture: .twoFingerTap) + // 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: "Shows Tap and LongPress gesture handling. " + "See log for details. DoubleTap / TwoFingerTap map action (zoom in/out) is disabled and replaced with a custom animation.") } + + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } // Conform to the TapDelegate protocol. func onTap(origin: Point2D) { @@ -114,8 +123,19 @@ class GesturesExample: 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/explore/ios/Gestures/Gestures/Info.plist b/examples/latest/explore/ios/Gestures/Gestures/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/explore/ios/Gestures/Gestures/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/Gestures/Gestures/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/explore/ios/Gestures/Gestures/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/explore/ios/Gestures/Gestures/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/Gestures/Gestures/ViewController.swift b/examples/latest/explore/ios/Gestures/Gestures/ViewController.swift deleted file mode 100644 index 36cf873d..00000000 --- a/examples/latest/explore/ios/Gestures/Gestures/ViewController.swift +++ /dev/null @@ -1,53 +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 { - - private var mapView: MapView! - private var gesturesExample: GesturesExample! - - override func viewDidLoad() { - super.viewDidLoad() - - // Initialize MapView without a storyboard. - mapView = MapView(frame: view.bounds) - view.addSubview(mapView) - - // 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. - gesturesExample = GesturesExample(viewController: self, mapView: mapView) - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/explore/ios/PublicTransit/PublicTransit.xcodeproj/project.pbxproj b/examples/latest/explore/ios/PublicTransit/PublicTransit.xcodeproj/project.pbxproj index 025dbe71..5e6a5960 100644 --- a/examples/latest/explore/ios/PublicTransit/PublicTransit.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/PublicTransit/PublicTransit.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - 2A968C4B26561CFE00913121 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A968C4A26561CFE00913121 /* AppDelegate.swift */; }; - 2A968C4F26561CFE00913121 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A968C4E26561CFE00913121 /* ViewController.swift */; }; - 2A968C5226561CFE00913121 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A968C5026561CFE00913121 /* Main.storyboard */; }; - 2A968C5426561CFE00913121 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A968C5326561CFE00913121 /* Assets.xcassets */; }; - 2A968C5726561CFE00913121 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A968C5526561CFE00913121 /* LaunchScreen.storyboard */; }; - 2A968C89265620DD00913121 /* PublicTransportRoutingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A968C88265620DD00913121 /* PublicTransportRoutingExample.swift */; }; - C8AE75702658378100B320DE /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8AE756F2658378100B320DE /* heresdk.xcframework */; }; - C8AE75712658378100B320DE /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C8AE756F2658378100B320DE /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837BC2C207F340004F54E /* PublicTransitApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* PublicTransitApp.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 /* PublicTransitExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* PublicTransitExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C8AE75722658378100B320DE /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C8AE75712658378100B320DE /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,66 +31,68 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 2A968C4726561CFD00913121 /* PublicTransit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PublicTransit.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 2A968C4A26561CFE00913121 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 2A968C4E26561CFE00913121 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 2A968C5126561CFE00913121 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 2A968C5326561CFE00913121 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 2A968C5626561CFE00913121 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 2A968C5826561CFF00913121 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 2A968C8426561E8400913121 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = heresdk.xcframework; path = "../../../HERESDK/4.7.3-release/heresdk-navigate-ios-4.7.3.0.5498/heresdk/frameworks/heresdk.xcframework"; sourceTree = ""; }; - 2A968C88265620DD00913121 /* PublicTransportRoutingExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicTransportRoutingExample.swift; sourceTree = ""; }; - C8AE756F2658378100B320DE /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* PublicTransit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PublicTransit.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* PublicTransitApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicTransitApp.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 /* PublicTransitExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicTransitExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 2A968C4426561CFD00913121 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C8AE75702658378100B320DE /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 2A968C3E26561CFD00913121 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - 2A968C4926561CFD00913121 /* PublicTransit */, - 2A968C4826561CFD00913121 /* Products */, - 2A968C8326561E8400913121 /* Frameworks */, + 83C837BA2C207F340004F54E /* PublicTransit */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - 2A968C4826561CFD00913121 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - 2A968C4726561CFD00913121 /* PublicTransit.app */, + 83C837B82C207F340004F54E /* PublicTransit.app */, ); name = Products; sourceTree = ""; }; - 2A968C4926561CFD00913121 /* PublicTransit */ = { + 83C837BA2C207F340004F54E /* PublicTransit */ = { isa = PBXGroup; children = ( - 2A968C4A26561CFE00913121 /* AppDelegate.swift */, - 2A968C5326561CFE00913121 /* Assets.xcassets */, - 2A968C5826561CFF00913121 /* Info.plist */, - 2A968C5526561CFE00913121 /* LaunchScreen.storyboard */, - 2A968C5026561CFE00913121 /* Main.storyboard */, - 2A968C88265620DD00913121 /* PublicTransportRoutingExample.swift */, - 2A968C4E26561CFE00913121 /* ViewController.swift */, + 83C837BB2C207F340004F54E /* PublicTransitApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* PublicTransitExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = PublicTransit; sourceTree = ""; }; - 2A968C8326561E8400913121 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C8AE756F2658378100B320DE /* heresdk.xcframework */, - 2A968C8426561E8400913121 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -99,14 +100,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 2A968C4626561CFD00913121 /* PublicTransit */ = { + 83C837B72C207F340004F54E /* PublicTransit */ = { isa = PBXNativeTarget; - buildConfigurationList = 2A968C7126561CFF00913121 /* Build configuration list for PBXNativeTarget "PublicTransit" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "PublicTransit" */; buildPhases = ( - 2A968C4326561CFD00913121 /* Sources */, - 2A968C4426561CFD00913121 /* Frameworks */, - 2A968C4526561CFD00913121 /* Resources */, - C8AE75722658378100B320DE /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -114,95 +115,76 @@ ); name = PublicTransit; productName = PublicTransit; - productReference = 2A968C4726561CFD00913121 /* PublicTransit.app */; + productReference = 83C837B82C207F340004F54E /* PublicTransit.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 2A968C3F26561CFD00913121 /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1240; - LastUpgradeCheck = 1250; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - 2A968C4626561CFD00913121 = { - CreatedOnToolsVersion = 12.4; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = 2A968C4226561CFD00913121 /* Build configuration list for PBXProject "PublicTransit" */; - compatibilityVersion = "Xcode 9.3"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "PublicTransit" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = 2A968C3E26561CFD00913121; - productRefGroup = 2A968C4826561CFD00913121 /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 2A968C4626561CFD00913121 /* PublicTransit */, + 83C837B72C207F340004F54E /* PublicTransit */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 2A968C4526561CFD00913121 /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2A968C5726561CFE00913121 /* LaunchScreen.storyboard in Resources */, - 2A968C5426561CFE00913121 /* Assets.xcassets in Resources */, - 2A968C5226561CFE00913121 /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 2A968C4326561CFD00913121 /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2A968C4F26561CFE00913121 /* ViewController.swift in Sources */, - 2A968C89265620DD00913121 /* PublicTransportRoutingExample.swift in Sources */, - 2A968C4B26561CFE00913121 /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* PublicTransitApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* PublicTransitExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - 2A968C5026561CFE00913121 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 2A968C5126561CFE00913121 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 2A968C5526561CFE00913121 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 2A968C5626561CFE00913121 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - 2A968C6F26561CFF00913121 /* 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; @@ -248,23 +230,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - 2A968C7026561CFF00913121 /* 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; @@ -304,58 +287,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - 2A968C7226561CFF00913121 /* 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 = "\"PublicTransit/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = PublicTransit/Info.plist; + 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 = 15.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; }; - 2A968C7326561CFF00913121 /* 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 = "\"PublicTransit/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = PublicTransit/Info.plist; + 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 = 15.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 */ - 2A968C4226561CFD00913121 /* Build configuration list for PBXProject "PublicTransit" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "PublicTransit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 2A968C6F26561CFF00913121 /* Debug */, - 2A968C7026561CFF00913121 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2A968C7126561CFF00913121 /* Build configuration list for PBXNativeTarget "PublicTransit" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "PublicTransit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 2A968C7226561CFF00913121 /* Debug */, - 2A968C7326561CFF00913121 /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 2A968C3F26561CFD00913121 /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/explore/ios/PublicTransit/PublicTransit/AppDelegate.swift b/examples/latest/explore/ios/PublicTransit/PublicTransit/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/explore/ios/PublicTransit/PublicTransit/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/explore/ios/PublicTransit/PublicTransit/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/explore/ios/PublicTransit/PublicTransit/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/explore/ios/PublicTransit/PublicTransit/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/PublicTransit/PublicTransit/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/explore/ios/PublicTransit/PublicTransit/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/explore/ios/PublicTransit/PublicTransit/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/explore/ios/PublicTransit/PublicTransit/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/PublicTransit/PublicTransit/Assets.xcassets/Contents.json b/examples/latest/explore/ios/PublicTransit/PublicTransit/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/explore/ios/PublicTransit/PublicTransit/Assets.xcassets/Contents.json +++ b/examples/latest/explore/ios/PublicTransit/PublicTransit/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/PublicTransit/PublicTransit/Base.lproj/LaunchScreen.storyboard b/examples/latest/explore/ios/PublicTransit/PublicTransit/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/explore/ios/PublicTransit/PublicTransit/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/PublicTransit/PublicTransit/Base.lproj/Main.storyboard b/examples/latest/explore/ios/PublicTransit/PublicTransit/Base.lproj/Main.storyboard deleted file mode 100644 index 47ec41a8..00000000 --- a/examples/latest/explore/ios/PublicTransit/PublicTransit/Base.lproj/Main.storyboard +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/PublicTransit/PublicTransit/ContentView.swift b/examples/latest/explore/ios/PublicTransit/PublicTransit/ContentView.swift new file mode 100644 index 00000000..0700824d --- /dev/null +++ b/examples/latest/explore/ios/PublicTransit/PublicTransit/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 publicTransitExample: PublicTransitExample? + + 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: "Add transit route") { + publicTransitExample?.addTransitRoute() + } + CustomButton(title: "Clear map") { + publicTransitExample?.clearMap() + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + publicTransitExample = PublicTransitExample(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/PublicTransit/PublicTransit/Info.plist b/examples/latest/explore/ios/PublicTransit/PublicTransit/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/explore/ios/PublicTransit/PublicTransit/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/PublicTransit/PublicTransit/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/explore/ios/PublicTransit/PublicTransit/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/explore/ios/PublicTransit/PublicTransit/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/PublicTransit/PublicTransit/PublicTransitApp.swift b/examples/latest/explore/ios/PublicTransit/PublicTransit/PublicTransitApp.swift new file mode 100644 index 00000000..98c6d989 --- /dev/null +++ b/examples/latest/explore/ios/PublicTransit/PublicTransit/PublicTransitApp.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 PublicTransitApp: 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/PublicTransit/PublicTransit/PublicTransportRoutingExample.swift b/examples/latest/explore/ios/PublicTransit/PublicTransit/PublicTransitExample.swift similarity index 88% rename from examples/latest/navigate/ios/PublicTransit/PublicTransit/PublicTransportRoutingExample.swift rename to examples/latest/explore/ios/PublicTransit/PublicTransit/PublicTransitExample.swift index de4277ec..c8ce7173 100644 --- a/examples/latest/navigate/ios/PublicTransit/PublicTransit/PublicTransportRoutingExample.swift +++ b/examples/latest/explore/ios/PublicTransit/PublicTransit/PublicTransitExample.swift @@ -20,9 +20,8 @@ import heresdk import UIKit -class PublicTranportRoutingExample { +class PublicTransitExample { - private var viewController: UIViewController private var mapView: MapView private var mapMarkers = [MapMarker]() private var mapPolylineList = [MapPolyline]() @@ -30,9 +29,10 @@ class PublicTranportRoutingExample { private var startGeoCoordinates: GeoCoordinates? private var destinationGeoCoordinates: GeoCoordinates? - 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), @@ -43,8 +43,18 @@ class PublicTranportRoutingExample { } catch let engineInstantiationError { fatalError("Failed to initialize routing engine. 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?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } + func addTransitRoute() { startGeoCoordinates = createRandomGeoCoordinatesAroundMapCenter() destinationGeoCoordinates = createRandomGeoCoordinatesAroundMapCenter() @@ -132,7 +142,7 @@ class PublicTranportRoutingExample { let destination = route.sections.last!.arrivalPlace.mapMatchedCoordinates // Draw a circle to indicate starting point and destination. - addCircleMapMarker(geoCoordinates: startPoint, imageName: "green_dot.png") + addCircleMapMarker(geoCoordinates: startPoint, imageName: "red_dot.png") addCircleMapMarker(geoCoordinates: destination, imageName: "green_dot.png") // Log maneuver instructions per route leg / sections. @@ -208,8 +218,19 @@ class PublicTranportRoutingExample { } 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/PublicTransit/PublicTransit/ViewController.swift b/examples/latest/explore/ios/PublicTransit/PublicTransit/ViewController.swift deleted file mode 100644 index 4ecd5213..00000000 --- a/examples/latest/explore/ios/PublicTransit/PublicTransit/ViewController.swift +++ /dev/null @@ -1,61 +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 publicTransportRoutingExample: PublicTranportRoutingExample! - 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 - } - - // Start the example. - self.publicTransportRoutingExample = PublicTranportRoutingExample(viewController: self, mapView: self.mapView!) - self.isMapSceneLoaded = true - } - - @IBAction func onAddTransitRouteButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - publicTransportRoutingExample.addTransitRoute() - } - } - - @IBAction func onClearMapButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - publicTransportRoutingExample.clearMap() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/explore/ios/PublicTransit/README.md b/examples/latest/explore/ios/PublicTransit/README.md index f26f04b5..966d2d2d 100644 --- a/examples/latest/explore/ios/PublicTransit/README.md +++ b/examples/latest/explore/ios/PublicTransit/README.md @@ -1,4 +1,4 @@ -The Public Transit example app shows how to calculate a public transport route from A to B that is visualized on the map. You can find how this is done in [PublicTransportRoutingExample.swift](PublicTransit/PublicTransportRoutingExample.swift). +The Public Transit example app shows how to calculate a public transport route from A to B that is visualized on the map. You can find how this is done in [PublicTransitExample.swift](PublicTransit/PublicTransitExample.swift). Build instructions: ------------------- diff --git a/examples/latest/explore/ios/Routing/Routing.xcodeproj/project.pbxproj b/examples/latest/explore/ios/Routing/Routing.xcodeproj/project.pbxproj index bcb54376..de06b26e 100644 --- a/examples/latest/explore/ios/Routing/Routing.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/Routing/Routing.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ diff --git a/examples/latest/explore/ios/Search/Search/SearchExample.swift b/examples/latest/explore/ios/Search/Search/SearchExample.swift index 4731b792..859cdf8a 100644 --- a/examples/latest/explore/ios/Search/Search/SearchExample.swift +++ b/examples/latest/explore/ios/Search/Search/SearchExample.swift @@ -83,7 +83,7 @@ class SearchExample: TapDelegate, let textQuery = TextQuery(queryString, area: queryArea) let searchOptions = SearchOptions(languageCode: LanguageCode.enUs, maxItems: 30) - _ = searchEngine.search(textQuery: textQuery, + _ = searchEngine.searchByText(textQuery, options: searchOptions, completion: onSearchCompleted) } @@ -129,15 +129,15 @@ class SearchExample: TapDelegate, let queryArea = TextQuery.Area(areaCenter: centerGeoCoordinates) // Simulate a user typing a search term. - _ = searchEngine.suggest(textQuery: TextQuery("p", area: queryArea), + _ = searchEngine.suggestByText(TextQuery("p", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) - _ = searchEngine.suggest(textQuery: TextQuery("pi", area: queryArea), + _ = searchEngine.suggestByText(TextQuery("pi", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) - _ = searchEngine.suggest(textQuery: TextQuery("piz", area: queryArea), + _ = searchEngine.suggestByText(TextQuery("piz", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) } @@ -177,7 +177,7 @@ class SearchExample: TapDelegate, let query = AddressQuery(queryString, near: geoCoordinates) let geocodingOptions = SearchOptions(languageCode: LanguageCode.deDe, maxItems: 25) - _ = searchEngine.search(addressQuery: query, + _ = searchEngine.searchByAddress(query, options: geocodingOptions, completion: onGeocodingCompleted) } @@ -263,7 +263,7 @@ class SearchExample: TapDelegate, // By default results are localized in EN_US. let reverseGeocodingOptions = SearchOptions(languageCode: LanguageCode.enGb, maxItems: 1) - _ = searchEngine.search(coordinates: geoCoordinates, + _ = searchEngine.searchByCoordinates(geoCoordinates, options: reverseGeocodingOptions, completion: onReverseGeocodingCompleted) } diff --git a/examples/latest/explore/ios/Traffic/README.md b/examples/latest/explore/ios/Traffic/README.md index 42d2122c..a1c970be 100644 --- a/examples/latest/explore/ios/Traffic/README.md +++ b/examples/latest/explore/ios/Traffic/README.md @@ -11,4 +11,4 @@ Note: If your framework version is different than the version shown in the _Deve Note: In Xcode, open the _General_ settings of the _App target_ and make sure that the HERE SDK framework appears under _Embedded Binaries_. If it does not appear, add the `heresdk.framework` to the _Embedded Binaries_ section ("Add other..." -> "Create folder references"). -Please do not forget: To run the app, you need to add your HERE SDK credentials to the `Info.plist` file of your project. More information can be found in the _Get Started_ section of the _Developer Guide_. +Please do not forget: To run the app, you need to add your HERE SDK credentials to the `AppDelegate.swift` file of your project. More information can be found in the _Get Started_ section of the _Developer Guide_. diff --git a/examples/latest/explore/ios/Traffic/Traffic.xcodeproj/project.pbxproj b/examples/latest/explore/ios/Traffic/Traffic.xcodeproj/project.pbxproj index bbc1ba30..b052d418 100644 --- a/examples/latest/explore/ios/Traffic/Traffic.xcodeproj/project.pbxproj +++ b/examples/latest/explore/ios/Traffic/Traffic.xcodeproj/project.pbxproj @@ -3,28 +3,30 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - C88C018623CDFD3A00043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018523CDFD3A00043918 /* heresdk.xcframework */; }; - C88C018723CDFD3A00043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018523CDFD3A00043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - C8D0BB6F2167DB0E002FD93D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BB6E2167DB0E002FD93D /* AppDelegate.swift */; }; - C8D0BB712167DB0E002FD93D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BB702167DB0E002FD93D /* ViewController.swift */; }; - C8D0BB742167DB0E002FD93D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BB722167DB0E002FD93D /* Main.storyboard */; }; - C8D0BB762167DB0F002FD93D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BB752167DB0F002FD93D /* Assets.xcassets */; }; - C8D0BB792167DB0F002FD93D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BB772167DB0F002FD93D /* LaunchScreen.storyboard */; }; - C8D0BB812167DC0A002FD93D /* TrafficExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BB802167DC0A002FD93D /* TrafficExample.swift */; }; + 83C066CA2CCC057A007A890F /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C066C92CCC057A007A890F /* heresdk.xcframework */; }; + 83C066CB2CCC057A007A890F /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C066C92CCC057A007A890F /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837BC2C207F340004F54E /* TrafficApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* TrafficApp.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 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; + 83C837CC2C20AAE50004F54E /* (null) in Embed Frameworks */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* TrafficExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* TrafficExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C8288835224BD428004903B8 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C018723CDFD3A00043918 /* heresdk.xcframework in Embed Frameworks */, + 83C066CB2CCC057A007A890F /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* (null) in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,79 +34,84 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C88C018523CDFD3A00043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; - C8D0BB6B2167DB0E002FD93D /* Traffic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Traffic.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C8D0BB6E2167DB0E002FD93D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C8D0BB702167DB0E002FD93D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C8D0BB732167DB0E002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C8D0BB752167DB0F002FD93D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C8D0BB782167DB0F002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C8D0BB7A2167DB0F002FD93D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C8D0BB802167DC0A002FD93D /* TrafficExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TrafficExample.swift; sourceTree = ""; }; + 83C066C92CCC057A007A890F /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Traffic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Traffic.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* TrafficApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrafficApp.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 = ""; }; + 83C837D02C20EFA70004F54E /* TrafficExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrafficExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C8D0BB682167DB0E002FD93D /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C018623CDFD3A00043918 /* heresdk.xcframework in Frameworks */, + 83C066CA2CCC057A007A890F /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* (null) in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C88C018423CDFD3A00043918 /* Frameworks */ = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C88C018523CDFD3A00043918 /* heresdk.xcframework */, + 83C837BA2C207F340004F54E /* Traffic */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); - name = Frameworks; sourceTree = ""; }; - C8D0BB622167DB0E002FD93D = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C8D0BB6D2167DB0E002FD93D /* Traffic */, - C8D0BB6C2167DB0E002FD93D /* Products */, - C88C018423CDFD3A00043918 /* Frameworks */, + 83C837B82C207F340004F54E /* Traffic.app */, ); + name = Products; sourceTree = ""; }; - C8D0BB6C2167DB0E002FD93D /* Products */ = { + 83C837BA2C207F340004F54E /* Traffic */ = { isa = PBXGroup; children = ( - C8D0BB6B2167DB0E002FD93D /* Traffic.app */, + 83C837BB2C207F340004F54E /* TrafficApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* TrafficExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); - name = Products; + path = Traffic; sourceTree = ""; }; - C8D0BB6D2167DB0E002FD93D /* Traffic */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C8D0BB6E2167DB0E002FD93D /* AppDelegate.swift */, - C8D0BB702167DB0E002FD93D /* ViewController.swift */, - C8D0BB802167DC0A002FD93D /* TrafficExample.swift */, - C8D0BB722167DB0E002FD93D /* Main.storyboard */, - C8D0BB752167DB0F002FD93D /* Assets.xcassets */, - C8D0BB772167DB0F002FD93D /* LaunchScreen.storyboard */, - C8D0BB7A2167DB0F002FD93D /* Info.plist */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, ); - path = Traffic; + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C066C92CCC057A007A890F /* heresdk.xcframework */, + ); + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C8D0BB6A2167DB0E002FD93D /* Traffic */ = { + 83C837B72C207F340004F54E /* Traffic */ = { isa = PBXNativeTarget; - buildConfigurationList = C8D0BB7D2167DB0F002FD93D /* Build configuration list for PBXNativeTarget "Traffic" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Traffic" */; buildPhases = ( - C8D0BB672167DB0E002FD93D /* Sources */, - C8D0BB682167DB0E002FD93D /* Frameworks */, - C8D0BB692167DB0E002FD93D /* Resources */, - C8288835224BD428004903B8 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -112,98 +119,76 @@ ); name = Traffic; productName = Traffic; - productReference = C8D0BB6B2167DB0E002FD93D /* Traffic.app */; + productReference = 83C837B82C207F340004F54E /* Traffic.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C8D0BB632167DB0E002FD93D /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1000; - LastUpgradeCheck = 1000; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C8D0BB6A2167DB0E002FD93D = { - CreatedOnToolsVersion = 10.0; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C8D0BB662167DB0E002FD93D /* Build configuration list for PBXProject "Traffic" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Traffic" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C8D0BB622167DB0E002FD93D; - productRefGroup = C8D0BB6C2167DB0E002FD93D /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C8D0BB6A2167DB0E002FD93D /* Traffic */, + 83C837B72C207F340004F54E /* Traffic */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C8D0BB692167DB0E002FD93D /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BB792167DB0F002FD93D /* LaunchScreen.storyboard in Resources */, - C8D0BB762167DB0F002FD93D /* Assets.xcassets in Resources */, - C8D0BB742167DB0E002FD93D /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C8D0BB672167DB0E002FD93D /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BB712167DB0E002FD93D /* ViewController.swift in Sources */, - C8D0BB6F2167DB0E002FD93D /* AppDelegate.swift in Sources */, - C8D0BB812167DC0A002FD93D /* TrafficExample.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* TrafficApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* TrafficExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C8D0BB722167DB0E002FD93D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BB732167DB0E002FD93D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C8D0BB772167DB0F002FD93D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BB782167DB0F002FD93D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C8D0BB7B2167DB0F002FD93D /* 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 +207,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; @@ -248,23 +234,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - C8D0BB7C2167DB0F002FD93D /* 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 +270,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; @@ -303,58 +291,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - C8D0BB7E2167DB0F002FD93D /* 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 = "\"Traffic/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Traffic/Info.plist; + 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 = 15.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; }; - C8D0BB7F2167DB0F002FD93D /* 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 = "\"Traffic/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Traffic/Info.plist; + 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 = 15.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 +363,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C8D0BB662167DB0E002FD93D /* Build configuration list for PBXProject "Traffic" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Traffic" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BB7B2167DB0F002FD93D /* Debug */, - C8D0BB7C2167DB0F002FD93D /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C8D0BB7D2167DB0F002FD93D /* Build configuration list for PBXNativeTarget "Traffic" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Traffic" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BB7E2167DB0F002FD93D /* Debug */, - C8D0BB7F2167DB0F002FD93D /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C8D0BB632167DB0E002FD93D /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/explore/ios/Traffic/Traffic/AppDelegate.swift b/examples/latest/explore/ios/Traffic/Traffic/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/explore/ios/Traffic/Traffic/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/explore/ios/Traffic/Traffic/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/explore/ios/Traffic/Traffic/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/explore/ios/Traffic/Traffic/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/Traffic/Traffic/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/explore/ios/Traffic/Traffic/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/explore/ios/Traffic/Traffic/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/explore/ios/Traffic/Traffic/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/Traffic/Traffic/Assets.xcassets/Contents.json b/examples/latest/explore/ios/Traffic/Traffic/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/explore/ios/Traffic/Traffic/Assets.xcassets/Contents.json +++ b/examples/latest/explore/ios/Traffic/Traffic/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/Traffic/Traffic/Base.lproj/LaunchScreen.storyboard b/examples/latest/explore/ios/Traffic/Traffic/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/explore/ios/Traffic/Traffic/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Traffic/Traffic/Base.lproj/Main.storyboard b/examples/latest/explore/ios/Traffic/Traffic/Base.lproj/Main.storyboard deleted file mode 100644 index ae3b324d..00000000 --- a/examples/latest/explore/ios/Traffic/Traffic/Base.lproj/Main.storyboard +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/explore/ios/Traffic/Traffic/ContentView.swift b/examples/latest/explore/ios/Traffic/Traffic/ContentView.swift new file mode 100644 index 00000000..34d21106 --- /dev/null +++ b/examples/latest/explore/ios/Traffic/Traffic/ContentView.swift @@ -0,0 +1,82 @@ +/* + * 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 trafficExample: TrafficExample? + + 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: "Enable All") { + trafficExample?.enableTrafficVisualization() + } + CustomButton(title: "DisableAll") { + trafficExample?.disableTrafficVisualization() + } + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + trafficExample = TrafficExample(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/Traffic/Traffic/Info.plist b/examples/latest/explore/ios/Traffic/Traffic/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/explore/ios/Traffic/Traffic/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/Traffic/Traffic/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/explore/ios/Traffic/Traffic/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/explore/ios/Traffic/Traffic/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/Gestures/Gestures/AppDelegate.swift b/examples/latest/explore/ios/Traffic/Traffic/TrafficApp.swift similarity index 63% rename from examples/latest/explore/ios/Gestures/Gestures/AppDelegate.swift rename to examples/latest/explore/ios/Traffic/Traffic/TrafficApp.swift index ed116e80..424ba018 100644 --- a/examples/latest/explore/ios/Gestures/Gestures/AppDelegate.swift +++ b/examples/latest/explore/ios/Traffic/Traffic/TrafficApp.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,21 +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 TrafficApp: 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() { @@ -46,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/Traffic/Traffic/TrafficExample.swift b/examples/latest/explore/ios/Traffic/Traffic/TrafficExample.swift index 574c594d..5e1f4552 100644 --- a/examples/latest/explore/ios/Traffic/Traffic/TrafficExample.swift +++ b/examples/latest/explore/ios/Traffic/Traffic/TrafficExample.swift @@ -20,17 +20,16 @@ import heresdk import UIKit -class TrafficExample: TapDelegate { - - private var viewController: UIViewController +class TrafficExample : TapDelegate { + private var mapView: MapView private var trafficEngine: TrafficEngine // Visualizes traffic incidents found with the TrafficEngine. private var mapPolylineList = [MapPolyline]() private var tappedGeoCoordinates: GeoCoordinates = GeoCoordinates(latitude: -1, longitude: -1) - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + + init(_ mapView: MapView) { self.mapView = mapView let camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) @@ -42,37 +41,39 @@ class TrafficExample: TapDelegate { } catch let engineInstantiationError { fatalError("Failed to initialize TrafficEngine. Cause: \(engineInstantiationError)") } + + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) // Setting a tap handler to pick and search for traffic incidents around the tapped area. mapView.gestures.tapDelegate = self - + showDialog(title: "Note", message: "Tap on the map to pick a traffic incident.") } - func onEnableAllButtonClicked() { - // Show real-time traffic lines and incidents on the map. - enableTrafficVisualization() - } - - func onDisableAllButtonClicked() { - disableTrafficVisualization() + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } } - private func enableTrafficVisualization() { + func enableTrafficVisualization() { // Once these layers are added to the map, they will be automatically updated while panning the map. mapView.mapScene.enableFeatures([MapFeatures.trafficFlow : MapFeatureModes.trafficFlowWithFreeFlow]) // MapFeatures.trafficIncidents renders traffic icons and lines to indicate the location of incidents. mapView.mapScene.enableFeatures([MapFeatures.trafficIncidents: MapFeatureModes.defaultMode]) } - - private func disableTrafficVisualization() { + + func disableTrafficVisualization() { mapView.mapScene.disableFeatures([MapFeatures.trafficFlow, MapFeatures.trafficIncidents]) // This clears only the custom visualization for incidents found with the TrafficEngine. clearTrafficIncidentsMapPolylines() } + // Conforming to TapDelegate protocol. func onTap(origin: Point2D) { // Can be nil when the map was tilted and the sky was tapped. @@ -86,7 +87,7 @@ class TrafficExample: TapDelegate { queryForIncidents(centerCoords: tappedGeoCoordinates) } } - + // Traffic incidents can only be picked, when MapScene.Layers.trafficIncidents is visible. func pickTrafficIncident(touchPointInPixels: Point2D) { let originInPixels = Point2D(x: touchPointInPixels.x, y: touchPointInPixels.y) @@ -103,7 +104,7 @@ class TrafficExample: TapDelegate { let filter = MapScene.MapPickFilter(filter: contentTypesToPickFrom); mapView.pick(filter:filter,inside: rectangle, completion: onPickMapContent) } - + // MapViewBase.PickMapContentHandler to receive picked map content. func onPickMapContent(mapPickResults: MapPickResult?) { guard let mapPickResults = mapPickResults else { @@ -139,7 +140,7 @@ class TrafficExample: TapDelegate { lookupOptions: trafficIncidentsLookupOptions, completion: onTrafficIncidentCompletion) } - + // TrafficIncidentCompletionHandler to receive traffic incidents from ID. func onTrafficIncidentCompletion(trafficQueryError: TrafficQueryError?, trafficIncident: TrafficIncident?) { if trafficQueryError == nil { @@ -170,7 +171,7 @@ class TrafficExample: TapDelegate { fatalError("Failed to render MapPolyline. Cause: \(error)") } } - + private func queryForIncidents(centerCoords: GeoCoordinates) { let geoCircle = GeoCircle(center: centerCoords, radiusInMeters: 1000) let trafficIncidentsQueryOptions = TrafficIncidentsQueryOptions() @@ -236,8 +237,19 @@ class TrafficExample: 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/explore/ios/Traffic/Traffic/ViewController.swift b/examples/latest/explore/ios/Traffic/Traffic/ViewController.swift deleted file mode 100644 index 5edc4ef1..00000000 --- a/examples/latest/explore/ios/Traffic/Traffic/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 trafficExample: TrafficExample! - 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. - trafficExample = TrafficExample(viewController: self, mapView: mapView!) - isMapSceneLoaded = true - } - - @IBAction func onEnableAllButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - trafficExample.onEnableAllButtonClicked() - } - } - - @IBAction func onDisableAllButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - trafficExample.onDisableAllButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/android/EVRouting/app/src/main/java/com/here/evrouting/EVRoutingExample.java b/examples/latest/navigate/android/EVRouting/app/src/main/java/com/here/evrouting/EVRoutingExample.java index 5829ad84..270fc570 100644 --- a/examples/latest/navigate/android/EVRouting/app/src/main/java/com/here/evrouting/EVRoutingExample.java +++ b/examples/latest/navigate/android/EVRouting/app/src/main/java/com/here/evrouting/EVRoutingExample.java @@ -309,7 +309,7 @@ private void searchAlongARoute(Route route) { searchOptions.languageCode = LanguageCode.EN_US; searchOptions.maxItems = 30; - searchEngine.search(textQuery, searchOptions, new SearchCallback() { + searchEngine.searchByText(textQuery, searchOptions, new SearchCallback() { @Override public void onSearchCompleted(SearchError searchError, List items) { if (searchError != null) { diff --git a/examples/latest/navigate/android/Navigation/app/src/main/java/com/here/navigation/NavigationEventHandler.java b/examples/latest/navigate/android/Navigation/app/src/main/java/com/here/navigation/NavigationEventHandler.java index 51e6d928..156426a2 100644 --- a/examples/latest/navigate/android/Navigation/app/src/main/java/com/here/navigation/NavigationEventHandler.java +++ b/examples/latest/navigate/android/Navigation/app/src/main/java/com/here/navigation/NavigationEventHandler.java @@ -39,7 +39,6 @@ import com.here.sdk.navigation.BorderCrossingWarningOptions; import com.here.sdk.navigation.DangerZoneWarning; import com.here.sdk.navigation.DangerZoneWarningListener; -import com.here.sdk.navigation.DangerZoneWarningOptions; import com.here.sdk.navigation.DestinationReachedListener; import com.here.sdk.navigation.DimensionRestrictionType; import com.here.sdk.navigation.DistanceType; @@ -54,7 +53,6 @@ import com.here.sdk.navigation.LaneType; import com.here.sdk.navigation.LowSpeedZoneWarning; import com.here.sdk.navigation.LowSpeedZoneWarningListener; -import com.here.sdk.navigation.LowSpeedZoneWarningOptions; import com.here.sdk.navigation.ManeuverNotificationOptions; import com.here.sdk.navigation.ManeuverProgress; import com.here.sdk.navigation.ManeuverViewLaneAssistance; @@ -82,7 +80,6 @@ import com.here.sdk.navigation.RouteProgressListener; import com.here.sdk.navigation.SafetyCameraWarning; import com.here.sdk.navigation.SafetyCameraWarningListener; -import com.here.sdk.navigation.SafetyCameraWarningOptions; import com.here.sdk.navigation.SchoolZoneWarning; import com.here.sdk.navigation.SchoolZoneWarningListener; import com.here.sdk.navigation.SchoolZoneWarningOptions; @@ -102,6 +99,8 @@ import com.here.sdk.navigation.TruckRestrictionWarning; import com.here.sdk.navigation.TruckRestrictionsWarningListener; import com.here.sdk.navigation.VisualNavigator; +import com.here.sdk.navigation.WarningNotificationDistances; +import com.here.sdk.navigation.WarningType; import com.here.sdk.navigation.WeightRestrictionType; import com.here.sdk.routing.CalculateTrafficOnRouteCallback; import com.here.sdk.routing.Maneuver; @@ -285,15 +284,6 @@ public void onSafetyCameraWarningUpdated(@NonNull SafetyCameraWarning safetyCame } }); - SafetyCameraWarningOptions safetyCameraWarningOptions = new SafetyCameraWarningOptions(); - // Warning distance setting for highways, defaults to 1500 meters. - safetyCameraWarningOptions.highwayWarningDistanceInMeters = 1600; - // Warning distance setting for rural roads, defaults to 750 meters. - safetyCameraWarningOptions.ruralWarningDistanceInMeters = 800; - // Warning distance setting for urban roads, defaults to 500 meters. - safetyCameraWarningOptions.urbanWarningDistanceInMeters = 600; - visualNavigator.setSafetyCameraWarningOptions(safetyCameraWarningOptions); - // Notifies when the current speed limit is exceeded. visualNavigator.setSpeedWarningListener(new SpeedWarningListener() { @Override @@ -504,12 +494,18 @@ public void onRoadAttributesUpdated(@NonNull RoadAttributes roadAttributes) { RoadSignWarningOptions roadSignWarningOptions = new RoadSignWarningOptions(); // Set a filter to get only shields relevant for TRUCKS and HEAVY_TRUCKS. roadSignWarningOptions.vehicleTypesFilter = Arrays.asList(RoadSignVehicleType.TRUCKS, RoadSignVehicleType.HEAVY_TRUCKS); - // Warning distance setting for highways, defaults to 1500 meters. - roadSignWarningOptions.highwayWarningDistanceInMeters = 1600; - // Warning distance setting for rural roads, defaults to 750 meters. - roadSignWarningOptions.ruralWarningDistanceInMeters = 800; - // Warning distance setting for urban roads, defaults to 500 meters. - roadSignWarningOptions.urbanWarningDistanceInMeters = 600; + + // Get notification distances for road sign alerts from visual navigator. + WarningNotificationDistances warningNotificationDistances = visualNavigator.getWarningNotificationDistances(WarningType.ROAD_SIGN); + // The distance in meters for emitting warnings when the speed limit or current speed is fast. Defaults to 1500. + warningNotificationDistances.fastSpeedDistanceInMeters = 1600; + // The distance in meters for emitting warnings when the speed limit or current speed is regular. Defaults to 750. + warningNotificationDistances.regularSpeedDistanceInMeters = 800; + // The distance in meters for emitting warnings when the speed limit or current speed is slow. Defaults to 500. + warningNotificationDistances.slowSpeedDistanceInMeters = 600; + + // Set the warning distances for road signs. + visualNavigator.setWarningNotificationDistances(WarningType.ROAD_SIGN, warningNotificationDistances); visualNavigator.setRoadSignWarningOptions(roadSignWarningOptions); // Notifies on road shields as they appear along the road. @@ -640,8 +636,6 @@ public void onBorderCrossingWarningUpdated(@NonNull BorderCrossingWarning border // If the value is false, all border crossing notifications will be given for both // country borders and state borders. Defaults to false. borderCrossingWarningOptions.filterOutStateBorderWarnings = true; - // Warning distance setting for urban, in meters. Defaults to 500 meters. - borderCrossingWarningOptions.urbanWarningDistanceInMeters = 400; visualNavigator.setBorderCrossingWarningOptions(borderCrossingWarningOptions); // Notifies on danger zones. @@ -669,11 +663,6 @@ public void onDangerZoneWarningsUpdated(@NonNull DangerZoneWarning dangerZoneWar } }); - DangerZoneWarningOptions dangerZoneWarningOptions = new DangerZoneWarningOptions(); - // Distance setting for urban, in meters. Defaults to 500 meters. - dangerZoneWarningOptions.urbanWarningDistanceInMeters = 400; - visualNavigator.setDangerZoneWarningOptions(dangerZoneWarningOptions); - // Notifies on low speed zones ahead - as indicated also on the map when MapFeatures.LOW_SPEED_ZONE is set. visualNavigator.setLowSpeedZoneWarningListener(new LowSpeedZoneWarningListener() { @Override @@ -690,11 +679,6 @@ public void onLowSpeedZoneWarningUpdated(@NonNull LowSpeedZoneWarning lowSpeedZo } }); - LowSpeedZoneWarningOptions lowSpeedZoneWarningOptions = new LowSpeedZoneWarningOptions(); - // Distance setting for urban, in meters. Defaults to 500 meters. - lowSpeedZoneWarningOptions.urbanWarningDistanceInMeters = 400; - visualNavigator.setLowSpeedZoneWarningOptions(lowSpeedZoneWarningOptions); - // Notifies whenever any textual attribute of the current road changes, i.e., the current road texts differ // from the previous one. This can be useful during tracking mode, when no maneuver information is provided. visualNavigator.setRoadTextsListener(new RoadTextsListener() { @@ -707,12 +691,6 @@ public void onRoadTextsUpdated(@NonNull RoadTexts roadTexts) { RealisticViewWarningOptions realisticViewWarningOptions = new RealisticViewWarningOptions(); realisticViewWarningOptions.aspectRatio = AspectRatio.ASPECT_RATIO_3_X_4; realisticViewWarningOptions.darkTheme = false; - // Warning distance setting for highways, defaults to 1500 meters. - realisticViewWarningOptions.highwayWarningDistanceInMeters = 1600; - // Warning distance setting for rural roads, defaults to 750 meters. - realisticViewWarningOptions.ruralWarningDistanceInMeters = 800; - // Warning distance setting for urban roads, defaults to 500 meters. - realisticViewWarningOptions.urbanWarningDistanceInMeters = 600; visualNavigator.setRealisticViewWarningOptions(realisticViewWarningOptions); // Notifies on signposts together with complex junction views. @@ -798,7 +776,12 @@ private void setupSpeedWarnings(VisualNavigator visualNavigator) { private void setupVoiceGuidance(VisualNavigator visualNavigator) { LanguageCode ttsLanguageCode = getLanguageCodeForDevice(VisualNavigator.getAvailableLanguagesForManeuverNotifications()); - visualNavigator.setManeuverNotificationOptions(new ManeuverNotificationOptions(ttsLanguageCode, UnitSystem.METRIC)); + ManeuverNotificationOptions maneuverNotificationOptions = new ManeuverNotificationOptions(); + // Set the language in which the notifications will be generated. + maneuverNotificationOptions.language = ttsLanguageCode; + // Set the measurement system used for distances. + maneuverNotificationOptions.unitSystem = UnitSystem.METRIC; + visualNavigator.setManeuverNotificationOptions(maneuverNotificationOptions); Log.d(TAG, "LanguageCode for maneuver notifications: " + ttsLanguageCode); // Set language to our TextToSpeech engine. diff --git a/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/OfflineMapsExample.java b/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/OfflineMapsExample.java index 325019cd..ced81933 100644 --- a/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/OfflineMapsExample.java +++ b/examples/latest/navigate/android/OfflineMaps/app/src/main/java/com/here/offlinemaps/OfflineMapsExample.java @@ -323,7 +323,7 @@ public void onSearchPlaceClicked() { searchOptions.languageCode = LanguageCode.EN_US; searchOptions.maxItems = 30; - offlineSearchEngine.search(textQuery, searchOptions, new SearchCallback() { + offlineSearchEngine.searchByText(textQuery, searchOptions, new SearchCallback() { @Override public void onSearchCompleted(@Nullable SearchError searchError, @Nullable List list) { if (searchError != null) { diff --git a/examples/latest/navigate/android/Search/app/src/main/java/com/here/search/SearchExample.java b/examples/latest/navigate/android/Search/app/src/main/java/com/here/search/SearchExample.java index b81eab15..748d7d21 100644 --- a/examples/latest/navigate/android/Search/app/src/main/java/com/here/search/SearchExample.java +++ b/examples/latest/navigate/android/Search/app/src/main/java/com/here/search/SearchExample.java @@ -148,7 +148,7 @@ private void getAddressForCoordinates(GeoCoordinates geoCoordinates) { reverseGeocodingOptions.languageCode = LanguageCode.EN_GB; reverseGeocodingOptions.maxItems = 1; - searchEngine.search(geoCoordinates, reverseGeocodingOptions, addressSearchCallback); + searchEngine.searchByCoordinates(geoCoordinates, reverseGeocodingOptions, addressSearchCallback); } private final SearchCallback addressSearchCallback = new SearchCallback() { @@ -225,7 +225,7 @@ private void searchInViewport(String queryString) { searchOptions.languageCode = LanguageCode.EN_US; searchOptions.maxItems = 30; - searchEngine.search(query, searchOptions, querySearchCallback); + searchEngine.searchByText(query, searchOptions, querySearchCallback); } private final SearchCallback querySearchCallback = new SearchCallback() { @@ -298,19 +298,19 @@ private void autoSuggestExample() { TextQuery.Area queryArea = new TextQuery.Area(centerGeoCoordinates); // Simulate a user typing a search term. - searchEngine.suggest( + searchEngine.suggestByText( new TextQuery("p", // User typed "p". queryArea), searchOptions, autosuggestCallback); - searchEngine.suggest( + searchEngine.suggestByText( new TextQuery("pi", // User typed "pi". queryArea), searchOptions, autosuggestCallback); - searchEngine.suggest( + searchEngine.suggestByText( new TextQuery("piz", // User typed "piz". queryArea), searchOptions, @@ -326,7 +326,7 @@ private void geocodeAddressAtLocation(String queryString, GeoCoordinates geoCoor options.languageCode = LanguageCode.DE_DE; options.maxItems = 30; - searchEngine.search(query, options, geocodeAddressSearchCallback); + searchEngine.searchByAddress(query, options, geocodeAddressSearchCallback); } private final SearchCallback geocodeAddressSearchCallback = new SearchCallback() { 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 c0a9f0fa..f43f56fb 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 @@ -159,9 +159,9 @@ private void getAddressForCoordinates(GeoCoordinates geoCoordinates) { reverseGeocodingOptions.maxItems = 1; if (isDeviceConnected()) { - searchEngine.search(geoCoordinates, reverseGeocodingOptions, addressSearchCallback); + searchEngine.searchByCoordinates(geoCoordinates, reverseGeocodingOptions, addressSearchCallback); } else { - offlineSearchEngine.search(geoCoordinates, reverseGeocodingOptions, addressSearchCallback); + offlineSearchEngine.searchByCoordinates(geoCoordinates, reverseGeocodingOptions, addressSearchCallback); } } @@ -240,9 +240,9 @@ private void searchInViewport(String queryString) { searchOptions.maxItems = 30; if (isDeviceConnected()) { - searchEngine.search(query, searchOptions, querySearchCallback); + searchEngine.searchByText(query, searchOptions, querySearchCallback); } else { - offlineSearchEngine.search(query, searchOptions, querySearchCallback); + offlineSearchEngine.searchByText(query, searchOptions, querySearchCallback); } } @@ -323,38 +323,38 @@ private void autoSuggestExample() { if (isDeviceConnected()) { // Simulate a user typing a search term. - searchEngine.suggest( + searchEngine.suggestByText( new TextQuery("p", // User typed "p". queryArea), searchOptions, autosuggestCallback); - searchEngine.suggest( + searchEngine.suggestByText( new TextQuery("pi", // User typed "pi". queryArea), searchOptions, autosuggestCallback); - searchEngine.suggest( + searchEngine.suggestByText( new TextQuery("piz", // User typed "piz". queryArea), searchOptions, autosuggestCallback); } else { // Simulate a user typing a search term. - offlineSearchEngine.suggest( + offlineSearchEngine.suggestByText( new TextQuery("p", // User typed "p". queryArea), searchOptions, autosuggestCallback); - offlineSearchEngine.suggest( + offlineSearchEngine.suggestByText( new TextQuery("pi", // User typed "pi". queryArea), searchOptions, autosuggestCallback); - offlineSearchEngine.suggest( + offlineSearchEngine.suggestByText( new TextQuery("piz", // User typed "piz". queryArea), searchOptions, @@ -372,9 +372,9 @@ private void geocodeAddressAtLocation(String queryString, GeoCoordinates geoCoor options.maxItems = 30; if (isDeviceConnected()) { - searchEngine.search(query, options, geocodeAddressSearchCallback); + searchEngine.searchByAddress(query, options, geocodeAddressSearchCallback); } else { - offlineSearchEngine.search(query, options, geocodeAddressSearchCallback); + offlineSearchEngine.searchByAddress(query, options, geocodeAddressSearchCallback); } } 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 c79523dd..005e4ecc 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 @@ -301,7 +301,7 @@ private void pickCartoPois(final Point2D touchPoint) { ", Place category: " + pickedPlace.placeCategoryId); // Optionally, you can now use the SearchEngine or the OfflineSearchEngine to retrieve more details. - searchEngine.searchPickedPlace(pickedPlace, LanguageCode.EN_US, new PlaceIdSearchCallback() { + searchEngine.searchByPickedPlace(pickedPlace, LanguageCode.EN_US, new PlaceIdSearchCallback() { @Override public void onPlaceIdSearchCompleted(@Nullable SearchError searchError, @Nullable Place place) { if (searchError == null) { @@ -331,8 +331,9 @@ public void onPlaceIdSearchCompleted(@Nullable SearchError searchError, @Nullabl if (!vehicleRestrictionResultList.isEmpty()) { PickMapContentResult.VehicleRestrictionResult topmostContent = vehicleRestrictionResultList.get(0); // Note that the text property is empty for general truck restrictions. - showDialog("Vehicle restriction picked", "Type: " + - topmostContent.restrictionType + ". " + topmostContent.text); + showDialog("Vehicle restriction picked:", "Location: " + + topmostContent.coordinates.latitude + ", " + + topmostContent.coordinates.longitude + ". " ); } }); } @@ -879,7 +880,7 @@ private void searchAlongARoute(Route route) { // Otherwise, a SearchError.FORBIDDEN will occur. searchEngine.setCustomOption("show", "truck"); - searchEngine.search(categoryQuery, searchOptions, new SearchCallback() { + searchEngine.searchByCategory(categoryQuery, searchOptions, new SearchCallback() { @Override public void onSearchCompleted(SearchError searchError, List items) { if (searchError != null) { diff --git a/examples/latest/navigate/flutter/camera_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/camera_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/camera_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/camera_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/camera_keyframe_tracks_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/camera_keyframe_tracks_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/camera_keyframe_tracks_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/camera_keyframe_tracks_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/carto_poi_picking_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/carto_poi_picking_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/carto_poi_picking_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/carto_poi_picking_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/custom_map_styles_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/custom_map_styles_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/custom_map_styles_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/custom_map_styles_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/custom_point_tile_source_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/custom_point_tile_source_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/custom_point_tile_source_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/custom_point_tile_source_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/build.gradle b/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/build.gradle index 7e19f530..fd02c439 100644 --- a/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/build.gradle +++ b/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/build.gradle @@ -31,7 +31,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.here.sdk.examples.custom_raster_layers_app" + applicationId "com.here.sdk.examples.custom_polygon_layers_app" minSdkVersion 24 targetSdkVersion 34 versionCode flutterVersionCode.toInteger() diff --git a/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/src/debug/AndroidManifest.xml b/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/src/debug/AndroidManifest.xml index 896d391d..dc982f94 100644 --- a/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/src/debug/AndroidManifest.xml +++ b/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.here.sdk.examples.custom_polygon_layers_app"> diff --git a/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/src/main/AndroidManifest.xml b/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/src/main/AndroidManifest.xml index f1674b7d..195dbd45 100644 --- a/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/src/main/AndroidManifest.xml +++ b/examples/latest/navigate/flutter/custom_polygon_layers_app/android/app/src/main/AndroidManifest.xml @@ -1,11 +1,11 @@ + package="com.here.sdk.examples.custom_polygon_layers_app"> + package="com.here.sdk.examples.custom_polygon_layers_app"> diff --git a/examples/latest/navigate/flutter/custom_polygon_layers_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/custom_polygon_layers_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/custom_polygon_layers_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/custom_polygon_layers_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/custom_polygon_layers_app/ios/Runner/Info.plist b/examples/latest/navigate/flutter/custom_polygon_layers_app/ios/Runner/Info.plist index aa1d1069..03df3cc1 100644 --- a/examples/latest/navigate/flutter/custom_polygon_layers_app/ios/Runner/Info.plist +++ b/examples/latest/navigate/flutter/custom_polygon_layers_app/ios/Runner/Info.plist @@ -11,7 +11,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - Custom Raster Layers + Custom Polygon Layers CFBundlePackageType APPL CFBundleShortVersionString diff --git a/examples/latest/navigate/flutter/custom_polygon_layers_app/pubspec.yaml b/examples/latest/navigate/flutter/custom_polygon_layers_app/pubspec.yaml index ca5a1867..8cdec1ab 100644 --- a/examples/latest/navigate/flutter/custom_polygon_layers_app/pubspec.yaml +++ b/examples/latest/navigate/flutter/custom_polygon_layers_app/pubspec.yaml @@ -1,4 +1,4 @@ -name: custom_raster_layers_app +name: custom_polygon_layers_app description: A new Flutter app that uses the HERE SDK for Flutter. # The following line prevents the package from being accidentally published to diff --git a/examples/latest/navigate/flutter/custom_raster_layers_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/custom_raster_layers_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/custom_raster_layers_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/custom_raster_layers_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/custom_raster_tile_source_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/custom_raster_tile_source_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/custom_raster_tile_source_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/custom_raster_tile_source_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/gestures_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/gestures_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/gestures_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/gestures_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/hello_map_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/hello_map_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/hello_map_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/hello_map_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/indoor_map_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/indoor_map_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/indoor_map_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/indoor_map_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/indoor_map_app/lib/drawing_switcher.dart b/examples/latest/navigate/flutter/indoor_map_app/lib/drawing_switcher.dart index 68f84737..7c8bd0e2 100644 --- a/examples/latest/navigate/flutter/indoor_map_app/lib/drawing_switcher.dart +++ b/examples/latest/navigate/flutter/indoor_map_app/lib/drawing_switcher.dart @@ -141,7 +141,7 @@ class DrawingSwitcherState extends State { ), child: Text( nameProp != null ? nameProp.asString : "", - textAlign: TextAlign.left, + textAlign: TextAlign.center, style: TextStyle( color: isSelectedDrawing ? Colors.blue : Colors.black, fontWeight: isSelectedDrawing ? FontWeight.bold : FontWeight.normal, 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 6d2555a3..e66f96a9 100644 --- a/examples/latest/navigate/flutter/indoor_map_app/lib/main.dart +++ b/examples/latest/navigate/flutter/indoor_map_app/lib/main.dart @@ -49,8 +49,8 @@ void _initializeHERESDK() async { SdkContext.init(IsolateOrigin.main); // Set your credentials for the HERE SDK. - String accessKeyId = "YOUR_ACCESS_KEY_ID"; - String accessKeySecret = "YOUR_ACCESS_KEY_SECRET"; + String accessKeyId = "VENUE_ACCESS_KEY_ID"; + String accessKeySecret = "VENUE_ACCESS_KEY_SECRET"; SDKOptions sdkOptions = SDKOptions.withAccessKeySecret(accessKeyId, accessKeySecret); try { diff --git a/examples/latest/navigate/flutter/map_items_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/map_items_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/map_items_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/map_items_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/navigation_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/navigation_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/navigation_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/navigation_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/navigation_custom/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/navigation_custom/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/navigation_custom/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/navigation_custom/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/navigation_quick_start_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/navigation_quick_start_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/navigation_quick_start_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/navigation_quick_start_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/positioning_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/positioning_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/positioning_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/positioning_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/public_transit_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/public_transit_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/public_transit_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/public_transit_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/routing_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/routing_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/routing_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/routing_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/routing_hybrid_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/routing_hybrid_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/routing_hybrid_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/routing_hybrid_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/search_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/search_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/search_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/search_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/flutter/search_app/lib/SearchExample.dart b/examples/latest/navigate/flutter/search_app/lib/SearchExample.dart index 125eded6..d4582ce4 100644 --- a/examples/latest/navigate/flutter/search_app/lib/SearchExample.dart +++ b/examples/latest/navigate/flutter/search_app/lib/SearchExample.dart @@ -222,7 +222,7 @@ class SearchExample { TextQueryArea queryArea = TextQueryArea.withCenter(centerGeoCoordinates); // Simulate a user typing a search term. - _searchEngine.suggest( + _searchEngine.suggestByText( TextQuery.withArea( "p", // User typed "p". queryArea), @@ -230,7 +230,7 @@ class SearchExample { _handleSuggestionResults(searchError, list); }); - _searchEngine.suggest( + _searchEngine.suggestByText( TextQuery.withArea( "pi", // User typed "pi". queryArea), @@ -238,7 +238,7 @@ class SearchExample { _handleSuggestionResults(searchError, list); }); - _searchEngine.suggest( + _searchEngine.suggestByText( TextQuery.withArea( "piz", // User typed "piz". queryArea), diff --git a/examples/latest/navigate/flutter/search_hybrid_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/search_hybrid_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/search_hybrid_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/search_hybrid_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, 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 69c4d41f..4e60d1ab 100644 --- a/examples/latest/navigate/flutter/search_hybrid_app/lib/SearchExample.dart +++ b/examples/latest/navigate/flutter/search_hybrid_app/lib/SearchExample.dart @@ -272,7 +272,7 @@ class SearchExample { if (useOnlineSearchEngine) { // Simulate a user typing a search term. - _onlineSearchEngine.suggest( + _onlineSearchEngine.suggestByText( TextQuery.withArea( "p", // User typed "p". queryArea), @@ -280,7 +280,7 @@ class SearchExample { _handleSuggestionResults(searchError, list); }); - _onlineSearchEngine.suggest( + _onlineSearchEngine.suggestByText( TextQuery.withArea( "pi", // User typed "pi". queryArea), @@ -288,7 +288,7 @@ class SearchExample { _handleSuggestionResults(searchError, list); }); - _onlineSearchEngine.suggest( + _onlineSearchEngine.suggestByText( TextQuery.withArea( "piz", // User typed "piz". queryArea), @@ -297,7 +297,7 @@ class SearchExample { }); } else { // Simulate a user typing a search term. - _offlineSearchEngine.suggest( + _offlineSearchEngine.suggestByText( TextQuery.withArea( "p", // User typed "p". queryArea), @@ -305,7 +305,7 @@ class SearchExample { _handleSuggestionResults(searchError, list); }); - _offlineSearchEngine.suggest( + _offlineSearchEngine.suggestByText( TextQuery.withArea( "pi", // User typed "pi". queryArea), @@ -313,7 +313,7 @@ class SearchExample { _handleSuggestionResults(searchError, list); }); - _offlineSearchEngine.suggest( + _offlineSearchEngine.suggestByText( TextQuery.withArea( "piz", // User typed "piz". queryArea), diff --git a/examples/latest/navigate/flutter/spatial_audio_navigation/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/spatial_audio_navigation/ios/Runner/AppDelegate.swift index c9ec6121..4c4e4b2d 100644 --- a/examples/latest/navigate/flutter/spatial_audio_navigation/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/spatial_audio_navigation/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate, BufferCompletionDelegate { var flutterChannel: FlutterMethodChannel? = nil // Create an object of AVAudioPlayerNodeManager to avoid creating multiple delegates, and send it as a parameter diff --git a/examples/latest/navigate/flutter/unit_testing_app/ios/Runner/AppDelegate.swift b/examples/latest/navigate/flutter/unit_testing_app/ios/Runner/AppDelegate.swift index b6363034..70693e4a 100644 --- a/examples/latest/navigate/flutter/unit_testing_app/ios/Runner/AppDelegate.swift +++ b/examples/latest/navigate/flutter/unit_testing_app/ios/Runner/AppDelegate.swift @@ -1,7 +1,7 @@ import UIKit import Flutter -@main +@UIApplicationMain @objc class AppDelegate: FlutterAppDelegate { override func application( _ application: UIApplication, diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks.xcodeproj/project.pbxproj index 0165b9e9..510730ed 100644 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks.xcodeproj/project.pbxproj @@ -3,32 +3,29 @@ archiveVersion = 1; classes = { }; - objectVersion = 55; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - 8680500927FEC05700B4F52A /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8680500827FEC05700B4F52A /* AppDelegate.swift */; }; - 8680500D27FEC05700B4F52A /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8680500C27FEC05700B4F52A /* ViewController.swift */; }; - 8680501027FEC05700B4F52A /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8680500E27FEC05700B4F52A /* Main.storyboard */; }; - 8680501227FEC05900B4F52A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8680501127FEC05900B4F52A /* Assets.xcassets */; }; - 8680501527FEC05900B4F52A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8680501327FEC05900B4F52A /* LaunchScreen.storyboard */; }; - 869BC1D528045EA500BBA419 /* Menu.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 869BC1D428045EA500BBA419 /* Menu.storyboard */; }; - 869BC1D728045F7B00BBA419 /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 869BC1D628045F7B00BBA419 /* MenuViewController.swift */; }; - 869BC1DA2804606F00BBA419 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 869BC1D92804606F00BBA419 /* heresdk.xcframework */; }; - 869BC1DB2804606F00BBA419 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 869BC1D92804606F00BBA419 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 869BC1E42804613500BBA419 /* RouteAnimationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 869BC1E32804613500BBA419 /* RouteAnimationExample.swift */; }; - 869BC1E62804615700BBA419 /* RouteCalculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 869BC1E52804615700BBA419 /* RouteCalculator.swift */; }; - 869BC1E82804617B00BBA419 /* CameraKeyframeTracksExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 869BC1E72804617B00BBA419 /* CameraKeyframeTracksExample.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 */; }; + 8641F3032CCA9F36005F6F3F /* CameraKeyframeTracksExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8641F3022CCA9F23005F6F3F /* CameraKeyframeTracksExample.swift */; }; + 8641F3052CCA9F72005F6F3F /* CameraKeyframeTracksApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8641F3042CCA9F6A005F6F3F /* CameraKeyframeTracksApp.swift */; }; + 8641F3082CCA9FB2005F6F3F /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8641F3072CCA9FAC005F6F3F /* ContentView.swift */; }; + 8658A30D2CCBE75E00B4BF3E /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C837CA2C20AAE50004F54E /* heresdk.xcframework */; }; + 8658A30F2CCBE77300B4BF3E /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 8658A30E2CCBE77300B4BF3E /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 86D2C6F72CCB6ACB0060CAA8 /* RouteAnimationExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86D2C6F62CCB6AC80060CAA8 /* RouteAnimationExample.swift */; }; + 86D2C6F92CCB6AEC0060CAA8 /* RouteCalculator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86D2C6F82CCB6AEA0060CAA8 /* RouteCalculator.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - 869BC1DC2804606F00BBA419 /* Embed Frameworks */ = { + 8658A30C2CCBE6BE00B4BF3E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - 869BC1DB2804606F00BBA419 /* heresdk.xcframework in Embed Frameworks */, + 8658A30F2CCBE77300B4BF3E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -36,72 +33,74 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 8680500527FEC05700B4F52A /* CameraKeyframeTracks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CameraKeyframeTracks.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 8680500827FEC05700B4F52A /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 8680500C27FEC05700B4F52A /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 8680500F27FEC05700B4F52A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 8680501127FEC05900B4F52A /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 8680501427FEC05900B4F52A /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 8680501627FEC05900B4F52A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 869BC1D428045EA500BBA419 /* Menu.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Menu.storyboard; sourceTree = ""; }; - 869BC1D628045F7B00BBA419 /* MenuViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MenuViewController.swift; sourceTree = ""; }; - 869BC1D92804606F00BBA419 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; - 869BC1E32804613500BBA419 /* RouteAnimationExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteAnimationExample.swift; sourceTree = ""; }; - 869BC1E52804615700BBA419 /* RouteCalculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteCalculator.swift; sourceTree = ""; }; - 869BC1E72804617B00BBA419 /* CameraKeyframeTracksExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraKeyframeTracksExample.swift; sourceTree = ""; }; + 83C837B82C207F340004F54E /* CameraKeyframeTracks.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CameraKeyframeTracks.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = ""; }; + 8641F3022CCA9F23005F6F3F /* CameraKeyframeTracksExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraKeyframeTracksExample.swift; sourceTree = ""; }; + 8641F3042CCA9F6A005F6F3F /* CameraKeyframeTracksApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraKeyframeTracksApp.swift; sourceTree = ""; }; + 8641F3072CCA9FAC005F6F3F /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 8658A30E2CCBE77300B4BF3E /* heresdk.xcframework */ = {isa = PBXFileReference; + lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 86D2C6F62CCB6AC80060CAA8 /* RouteAnimationExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteAnimationExample.swift; sourceTree = ""; }; + 86D2C6F82CCB6AEA0060CAA8 /* RouteCalculator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RouteCalculator.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 8680500227FEC05700B4F52A /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 869BC1DA2804606F00BBA419 /* heresdk.xcframework in Frameworks */, + 8658A30D2CCBE75E00B4BF3E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 86804FFC27FEC05700B4F52A = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - 8680500727FEC05700B4F52A /* CameraKeyframeTracks */, - 8680500627FEC05700B4F52A /* Products */, - 869BC1D82804606F00BBA419 /* Frameworks */, + 8658A30E2CCBE77300B4BF3E /* heresdk.xcframework */, + 83C837BA2C207F340004F54E /* CameraKeyframeTracks */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - 8680500627FEC05700B4F52A /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - 8680500527FEC05700B4F52A /* CameraKeyframeTracks.app */, + 83C837B82C207F340004F54E /* CameraKeyframeTracks.app */, ); name = Products; sourceTree = ""; }; - 8680500727FEC05700B4F52A /* CameraKeyframeTracks */ = { + 83C837BA2C207F340004F54E /* CameraKeyframeTracks */ = { isa = PBXGroup; children = ( - 8680500E27FEC05700B4F52A /* Main.storyboard */, - 8680501127FEC05900B4F52A /* Assets.xcassets */, - 8680501327FEC05900B4F52A /* LaunchScreen.storyboard */, - 8680501627FEC05900B4F52A /* Info.plist */, - 869BC1D428045EA500BBA419 /* Menu.storyboard */, - 8680500827FEC05700B4F52A /* AppDelegate.swift */, - 8680500C27FEC05700B4F52A /* ViewController.swift */, - 869BC1D628045F7B00BBA419 /* MenuViewController.swift */, - 869BC1E32804613500BBA419 /* RouteAnimationExample.swift */, - 869BC1E52804615700BBA419 /* RouteCalculator.swift */, - 869BC1E72804617B00BBA419 /* CameraKeyframeTracksExample.swift */, + 86D2C6F82CCB6AEA0060CAA8 /* RouteCalculator.swift */, + 86D2C6F62CCB6AC80060CAA8 /* RouteAnimationExample.swift */, + 8641F3042CCA9F6A005F6F3F /* CameraKeyframeTracksApp.swift */, + 8641F3022CCA9F23005F6F3F /* CameraKeyframeTracksExample.swift */, + 8641F3072CCA9FAC005F6F3F /* ContentView.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = CameraKeyframeTracks; sourceTree = ""; }; - 869BC1D82804606F00BBA419 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - 869BC1D92804606F00BBA419 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -109,14 +108,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 8680500427FEC05700B4F52A /* CameraKeyframeTracks */ = { + 83C837B72C207F340004F54E /* CameraKeyframeTracks */ = { isa = PBXNativeTarget; - buildConfigurationList = 8680501927FEC05900B4F52A /* Build configuration list for PBXNativeTarget "CameraKeyframeTracks" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CameraKeyframeTracks" */; buildPhases = ( - 8680500127FEC05700B4F52A /* Sources */, - 8680500227FEC05700B4F52A /* Frameworks */, - 8680500327FEC05700B4F52A /* Resources */, - 869BC1DC2804606F00BBA419 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 8658A30C2CCBE6BE00B4BF3E /* Embed Frameworks */, ); buildRules = ( ); @@ -124,100 +123,78 @@ ); name = CameraKeyframeTracks; productName = CameraKeyframeTracks; - productReference = 8680500527FEC05700B4F52A /* CameraKeyframeTracks.app */; + productReference = 83C837B82C207F340004F54E /* CameraKeyframeTracks.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 86804FFD27FEC05700B4F52A /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = 1; - LastSwiftUpdateCheck = 1300; - LastUpgradeCheck = 1300; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - 8680500427FEC05700B4F52A = { - CreatedOnToolsVersion = 13.0; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = 8680500027FEC05700B4F52A /* Build configuration list for PBXProject "CameraKeyframeTracks" */; - compatibilityVersion = "Xcode 13.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CameraKeyframeTracks" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = 86804FFC27FEC05700B4F52A; - productRefGroup = 8680500627FEC05700B4F52A /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 8680500427FEC05700B4F52A /* CameraKeyframeTracks */, + 83C837B72C207F340004F54E /* CameraKeyframeTracks */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 8680500327FEC05700B4F52A /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 8680501527FEC05900B4F52A /* LaunchScreen.storyboard in Resources */, - 8680501227FEC05900B4F52A /* Assets.xcassets in Resources */, - 8680501027FEC05700B4F52A /* Main.storyboard in Resources */, - 869BC1D528045EA500BBA419 /* Menu.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 8680500127FEC05700B4F52A /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 869BC1E62804615700BBA419 /* RouteCalculator.swift in Sources */, - 869BC1E42804613500BBA419 /* RouteAnimationExample.swift in Sources */, - 8680500D27FEC05700B4F52A /* ViewController.swift in Sources */, - 869BC1D728045F7B00BBA419 /* MenuViewController.swift in Sources */, - 8680500927FEC05700B4F52A /* AppDelegate.swift in Sources */, - 869BC1E82804617B00BBA419 /* CameraKeyframeTracksExample.swift in Sources */, + 86D2C6F72CCB6ACB0060CAA8 /* RouteAnimationExample.swift in Sources */, + 8641F3082CCA9FB2005F6F3F /* ContentView.swift in Sources */, + 8641F3052CCA9F72005F6F3F /* CameraKeyframeTracksApp.swift in Sources */, + 8641F3032CCA9F36005F6F3F /* CameraKeyframeTracksExample.swift in Sources */, + 86D2C6F92CCB6AEC0060CAA8 /* RouteCalculator.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - 8680500E27FEC05700B4F52A /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 8680500F27FEC05700B4F52A /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 8680501327FEC05900B4F52A /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 8680501427FEC05900B4F52A /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - 8680501727FEC05900B4F52A /* 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++17"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -247,7 +224,8 @@ 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; @@ -262,23 +240,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - 8680501827FEC05900B4F52A /* 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++17"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_ENABLE_OBJC_WEAK = YES; @@ -308,7 +287,8 @@ 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; @@ -317,29 +297,29 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - 8680501A27FEC05900B4F52A /* 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 = "\"CameraKeyframeTracks/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; + ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = CameraKeyframeTracks/Info.plist; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 15.0; @@ -348,7 +328,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -356,20 +336,20 @@ }; name = Debug; }; - 8680501B27FEC05900B4F52A /* 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 = "\"CameraKeyframeTracks/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; + ENABLE_PREVIEWS = YES; GENERATE_INFOPLIST_FILE = YES; - INFOPLIST_FILE = CameraKeyframeTracks/Info.plist; + INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES; INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES; - INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen; - INFOPLIST_KEY_UIMainStoryboardFile = Main; + INFOPLIST_KEY_UILaunchScreen_Generation = YES; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; IPHONEOS_DEPLOYMENT_TARGET = 15.0; @@ -378,7 +358,7 @@ "@executable_path/Frameworks", ); MARKETING_VERSION = 1.0; - PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.example; + PRODUCT_BUNDLE_IDENTIFIER = com.here.sdk.examples; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; SWIFT_VERSION = 5.0; @@ -389,25 +369,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 8680500027FEC05700B4F52A /* Build configuration list for PBXProject "CameraKeyframeTracks" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CameraKeyframeTracks" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8680501727FEC05900B4F52A /* Debug */, - 8680501827FEC05900B4F52A /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 8680501927FEC05900B4F52A /* Build configuration list for PBXNativeTarget "CameraKeyframeTracks" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CameraKeyframeTracks" */ = { isa = XCConfigurationList; buildConfigurations = ( - 8680501A27FEC05900B4F52A /* Debug */, - 8680501B27FEC05900B4F52A /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 86804FFD27FEC05700B4F52A /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/AppDelegate.swift b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/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/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/AppIcon.appiconset/Contents.json index 9221b9bb..13613e3e 100644 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -1,93 +1,8 @@ { "images" : [ { - "idiom" : "iphone", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "20x20" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "29x29" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "40x40" - }, - { - "idiom" : "iphone", - "scale" : "2x", - "size" : "60x60" - }, - { - "idiom" : "iphone", - "scale" : "3x", - "size" : "60x60" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "20x20" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "29x29" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "40x40" - }, - { - "idiom" : "ipad", - "scale" : "1x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "76x76" - }, - { - "idiom" : "ipad", - "scale" : "2x", - "size" : "83.5x83.5" - }, - { - "idiom" : "ios-marketing", - "scale" : "1x", + "idiom" : "universal", + "platform" : "ios", "size" : "1024x1024" } ], diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/menu.png b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Assets.xcassets/menu.imageset/menu.png deleted file mode 100644 index 54ee7c36901f19ac258e373f11c21d1817be6db0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1276 zcmVP000>X1^@s6#OZ}&000CIX+uL$YePpv zZ)|UJQ*dEpWk+RhWpZg_Qb$4n062|}Rb6NtRTMs(xw9)I&V$sZrjic+HI%e$QqhFk z=>BE1ZQLxAY_vg;$?V;oX(lt{{G@3qJ`_O^!KmPq;Qw2}Cn0L9?Tam?khm;cmfj@-EE=vY<#k5o0f^m&*sM6pBI0EL{uRZtU4R5Z z`^X8`V)zNfJ8YaF;u6EP09P2E5Ad?jnUOMxUqvh^s*L``+lU9}BlcPZ2XpY-jyyG} zttleQMaed+noc9ry@UIIwng1*#M^^UkFzj+6yF25_LnMhmf?pGpH<}CbcnAmX|u%; z|7E#p3GpKUUAw%6atiT2#A8)^yd3Cssj4^8z$>TJnP(8+gLrkpJj%xIMEtceUz`ec zeo~wa<_{hK;NmJRuzL3+9o0iVC08s$)vACv7|KExH6jmbd4gn8^0FkllzkRT6fd|P0n zrwSVAXrbt(XrcJk;OyVRDf#{Yw^VBW$m{6QFhZvPBk<6w!tZERBfJcLd1$M3&)TehHS09YRtkN(Z(GDi^F2;vKBX;HY+Q*UEnTqUvgh@A9J5aYSek}G;8j! zqp=F+X_rylpF&#LEj%b>g+0Q~5^H*5N-?MwSLAe5T{?GXqX;9WfX;*4pXw6&V*io?m|<6;W0GAb4f<-njQ>$>Q>9MPr@ zwU=n+0I+*9IKpp9{{0u*d8K7@p9VPmCp-6AwmA>rtOL;dXv;Q$XXCx^0IWWyc=l3w zC&Xgk0yx!!!@*Zi8qcdA>-AfBZYACT*nGWS|NH%Vee(m<-vGFv{{#Oecnig2*2@3@ z061k>NoGw=04e|g00;m9hiL!=000010000Q0000000N)_00aO40096102!bI00aO4 z0096102u%P004VCwPXMQ0A)!;K~zW$V`N}p_z%Q11xz$G9cuWfCG-g8Q9Fiu2rvRY zfGx-0p}=D*=z4Kkg07At{_x51EI7h}>Tv?IhaJcuHTb^6G>_6lD+ER}BT4Z^YQ7-J maF}9jIsOw&l1!QpT^|6xJ_sB_lsmux0000 - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/Main.storyboard deleted file mode 100644 index 028accb8..00000000 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Base.lproj/Main.storyboard +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksApp.swift b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksApp.swift new file mode 100644 index 00000000..67d86440 --- /dev/null +++ b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksApp.swift @@ -0,0 +1,72 @@ + +/* + * 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 CameraKeyframeTracksApp: 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/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksExample.swift b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksExample.swift index 456ce776..3c69cf9f 100644 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksExample.swift +++ b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/CameraKeyframeTracksExample.swift @@ -17,40 +17,41 @@ * License-Filename: LICENSE */ -import UIKit import heresdk +import SwiftUI -public class CameraKeyframeTracksExample: AnimationDelegate { +/// `CameraKeyframeTracksExample` provides functionality for animating the map camera along a series of keyframes. +class CameraKeyframeTracksExample: AnimationDelegate { private final let tag = String(describing: CameraKeyframeTracksExample.self) - private let viewController: UIViewController - private var mapView: MapView! - private var tracks: [MapCameraKeyframeTrack]! private let geoCoordinates = GeoCoordinates(latitude: 40.685869754854544, longitude: -74.02550202768754) + private var tracks: [MapCameraKeyframeTrack]! + private var mapView: MapView + private var disableOptimization = true + private var waypoints: Array = Array() - 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), + zoom: distanceInMeters) + + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) } - public func startTripToNYC() { - // This animation can be started and replayed. When started, it will always start from globe view. - let mapCameraKeyframeTracks: [MapCameraKeyframeTrack]? = createMapCameraKeyframeTracks() - - let mapCameraAnimation: MapCameraAnimation - - do { - mapCameraAnimation = try MapCameraAnimationFactory.createAnimation(tracks: mapCameraKeyframeTracks!) - } catch let mapCameraKeyframeTrackException { - print(tag + "Error occured: " + mapCameraKeyframeTrackException.localizedDescription) - return + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + guard mapError == nil else { + print("Error: Map scene not loaded, \(String(describing: mapError))") + return } - - // This animation can be started and replayed. When started, it will always start from the first keyframe. - mapView.camera.startAnimation(mapCameraAnimation, animationDelegate: self) } - - public func onAnimationStateChanged(state: AnimationState) { + + func onAnimationStateChanged(state: heresdk.AnimationState) { switch (state) { case .started: print(tag + "Animation started.") @@ -67,6 +68,23 @@ public class CameraKeyframeTracksExample: AnimationDelegate { } } + public func startTripToNYC() { + // This animation can be started and replayed. When started, it will always start from globe view. + let mapCameraKeyframeTracks: [MapCameraKeyframeTrack]? = createMapCameraKeyframeTracks() + + let mapCameraAnimation: MapCameraAnimation + + do { + mapCameraAnimation = try MapCameraAnimationFactory.createAnimation(tracks: mapCameraKeyframeTracks!) + } catch let mapCameraKeyframeTrackException { + print(tag + "Error occured: " + mapCameraKeyframeTrackException.localizedDescription) + return + } + + // This animation can be started and replayed. When started, it will always start from the first keyframe. + mapView.camera.startAnimation(mapCameraAnimation, animationDelegate: self) + } + public func stopTripToNYCAnimation() { mapView.camera.cancelAnimations() } @@ -165,9 +183,21 @@ public class CameraKeyframeTracksExample: AnimationDelegate { return geoOrientationKeyframe } - 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 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/CameraKeyframeTracks/CameraKeyframeTracks/ContentView.swift b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/ContentView.swift new file mode 100644 index 00000000..bf7590c9 --- /dev/null +++ b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/ContentView.swift @@ -0,0 +1,160 @@ +/* + * Copyright (C) 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 variable to control the visibility of the menu. + @State private var showMenu = false + @State private var mapView = MapView() + @State private var cameraKeyframeTracksExample: CameraKeyframeTracksExample? + @State private var routeAnimationExample: RouteAnimationExample? + + var body: some View { + NavigationView { + ZStack(alignment: .top) { + + // The map view should fill the entire screen. + WrappedMapView(mapView: $mapView) + .edgesIgnoringSafeArea(.all) + + VStack { + HStack { + CustomMenuButton(showMenu: $showMenu) + Spacer() + } + Spacer() + } + } + .sheet(isPresented: $showMenu) { + // Presents the menu view as a sheet when showMenu is true. + MenuView(menuSections: buildMenuSections()) + } + .onAppear { + // ContentView appeared, now we init the examples. + cameraKeyframeTracksExample = CameraKeyframeTracksExample(mapView) + routeAnimationExample = RouteAnimationExample(mapView) + } + } + } + + /// Builds the sections for the menu. Each section contains items that trigger animations. + /// + /// - Returns: An array of `MenuSection` representing the available menu items. + private func buildMenuSections() -> [MenuSection] { + return [ + MenuSection(title: "Animate to Route", items: [ + MenuItem(title: "Start Animation", onSelect: onStartAnimationToRouteButtonClicked), + MenuItem(title: "Stop Animation", onSelect: onStopAnimationToRouteButtonClicked) + ]), + MenuSection(title: "Trip to NYC", items: [ + MenuItem(title: "Start trip to NYC", onSelect: onStartTripToNYCButtonClicked), + MenuItem(title: "Stop trip to NYC", onSelect: onStopTripToNYCButtonClicked) + ]) + ] + } + + /// Represents a menu item in the menu view. + struct MenuItem { + let title: String + let onSelect: () -> Void + } + + /// Represents a section in the menu view, which contains a list of menu items. + struct MenuSection { + let title: String + let items: [MenuItem] + } + + /// View for displaying the menu. Each menu section and item triggers its respective action. + struct MenuView: View { + var menuSections: [MenuSection] + @Environment(\.dismiss) var dismiss + + var body: some View { + NavigationView { + List { + ForEach(menuSections, id: \.title) { section in + Section(header: Text(section.title)) { + ForEach(section.items, id: \.title) { item in + Button(action: { + item.onSelect() + dismiss() + }) { + Text(item.title) + } + } + } + } + } + .navigationBarTitle("Menu") + } + } + } + + private func onStartAnimationToRouteButtonClicked() { + routeAnimationExample?.animateToRoute() + } + + private func onStopAnimationToRouteButtonClicked() { + routeAnimationExample?.stopRouteAnimation() + } + + private func onStartTripToNYCButtonClicked() { + cameraKeyframeTracksExample?.startTripToNYC() + } + + private func onStopTripToNYCButtonClicked() { + cameraKeyframeTracksExample?.stopTripToNYCAnimation() + } + + /// `CustomMenuButton` is a reusable SwiftUI view that displays a button with a menu icon. + private struct CustomMenuButton: View { + // Use @Binding to connect to the state from the parent view. + @Binding var showMenu: Bool + + var body: some View { + Button(action: { + showMenu.toggle() + }) { + Image(systemName: "line.horizontal.3") + .resizable() + .frame(width: 25, height: 25) + } + .padding() + } + } + + /// `WrappedMapView` is a wrapper around the HERE SDK `MapView` to make it compatible with SwiftUI. + /// It uses `UIViewRepresentable` to bridge UIKit with SwiftUI + 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/CameraKeyframeTracks/CameraKeyframeTracks/Info.plist b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/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/CameraKeyframeTracks/CameraKeyframeTracks/Menu.storyboard b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Menu.storyboard deleted file mode 100644 index 6938d6ab..00000000 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Menu.storyboard +++ /dev/null @@ -1,51 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/MenuViewController.swift b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/MenuViewController.swift deleted file mode 100644 index 53561ce5..00000000 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/MenuViewController.swift +++ /dev/null @@ -1,106 +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 UIKit - -struct MenuItem { - let title: String - let onSelect: (Any) -> Void -} - -struct MenuSection { - let title: String - let items: [MenuItem] -} - -// A helper class to show a menu. -class MenuViewController: UIViewController { - - var menuSections: [MenuSection] = [] - - override func viewDidLoad() { - super.viewDidLoad() - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - } -} - -extension MenuViewController: UITableViewDataSource { - - func numberOfSections(in tableView: UITableView) -> Int { - return menuSections.count - } - - func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { - guard section >= 0, section < menuSections.count else { - return 0 - } - - return menuSections[section].items.count - } - - func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { - - let cell = tableView.dequeueReusableCell(withIdentifier: "MenuItem", for: indexPath) - - let section = indexPath.section - guard section >= 0, section < menuSections.count else { - return cell - } - - let row = indexPath.row - guard row >= 0, row < menuSections[section].items.count else { - return cell - } - - cell.textLabel?.text = menuSections[section].items[row].title - return cell - } - - func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? { - guard section >= 0, section < menuSections.count else { - return nil - } - - return menuSections[section].title - } -} - -extension MenuViewController: UITableViewDelegate { - - func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { - let section = indexPath.section - guard section >= 0, section < menuSections.count else { - dismiss(animated: true, completion: nil) - return - } - - let row = indexPath.row - guard row >= 0, row < menuSections[section].items.count else { - dismiss(animated: true, completion: nil) - return - } - - menuSections[section].items[row].onSelect(self) - dismiss(animated: true, completion: nil) - } -} - diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteAnimationExample.swift b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteAnimationExample.swift index 61b47bfe..d5707980 100644 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteAnimationExample.swift +++ b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteAnimationExample.swift @@ -17,12 +17,13 @@ * License-Filename: LICENSE */ -import UIKit +import SwiftUI import heresdk +/// `RouteAnimationExample` is responsible for animating the camera along a predefined route on the HERE SDK map. +/// This class provides functions to start and stop route animations, moving the camera to display a route with transitions. public class RouteAnimationExample { - - private let viewController: UIViewController + private var mapView: MapView! private var tracks: [MapCameraKeyframeTrack]! private var mapPolylines: [MapPolyline] = [] @@ -30,8 +31,7 @@ public class RouteAnimationExample { private var route: Route? private let geoCoordinates = GeoCoordinates(latitude: 40.685869754854544, longitude: -74.02550202768754) - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView routeCalculator = RouteCalculator(mapView: mapView) @@ -67,3 +67,4 @@ public class RouteAnimationExample { mapView.camera.startAnimation(animation) } } + diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteCalculator.swift b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteCalculator.swift index b87b9716..9ab1a3cc 100644 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteCalculator.swift +++ b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/RouteCalculator.swift @@ -18,7 +18,7 @@ */ import heresdk -import UIKit +import SwiftUI // A class that creates car Routes with the HERE SDK. public class RouteCalculator { @@ -75,3 +75,4 @@ public class RouteCalculator { } } } + diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/ViewController.swift b/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/ViewController.swift deleted file mode 100644 index 077a5510..00000000 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/CameraKeyframeTracks/ViewController.swift +++ /dev/null @@ -1,123 +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 cameraKeyframeTracksExample: CameraKeyframeTracksExample! - private var routeAnimationExample: RouteAnimationExample! - private var isMapSceneLoaded = true - private var menuSections: [MenuSection] = [] - private let geoCoordinates = GeoCoordinates(latitude: 40.71083291395444, longitude: -74.01226399217569) - - 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) - - menuSections = buildMenuSections() - } - - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - // Users of the Navigate Edition can enable textured landmarks: - // mapView.mapScene.enableFeatures([MapFeatures.landmarks : MapFeatureModes.landmarksTextured]) - - let distanceInMeters = MapMeasure(kind: .distance, value: 5000) - mapView.camera.lookAt(point: geoCoordinates, zoom: distanceInMeters) - - // Start the examples. - isMapSceneLoaded = true - cameraKeyframeTracksExample = CameraKeyframeTracksExample(viewController: self, mapView: mapView) - routeAnimationExample = RouteAnimationExample(viewController: self, mapView: mapView) - } - - public override func prepare(for segue: UIStoryboardSegue, sender _: Any?) { - if segue.identifier == "showMenu" { - if let vc = segue.destination as? MenuViewController { - vc.menuSections = menuSections - } - } - } - - @IBAction func onMenuButtonClicked(_ sender: UIBarButtonItem) { - performSegue(withIdentifier: "showMenu", sender: nil) - } - - private func onStartAnimationToRouteButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - - routeAnimationExample.animateToRoute() - } - } - - private func onStopAnimationToRouteButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - routeAnimationExample.stopRouteAnimation() - } - } - - private func onStartTripToNYCButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraKeyframeTracksExample.startTripToNYC() - } - } - - private func onStopTripToNYCButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - cameraKeyframeTracksExample.stopTripToNYCAnimation() - } - } - - // A helper method to build drawer menu items. - private func buildMenuSections() -> [MenuSection] { - return [ - buildAnimateToRouteMenuSection(), - buildTripToNYCMenuSection(), - ] - } - - private func buildAnimateToRouteMenuSection() -> MenuSection { - return MenuSection(title: "Animate to route", items: [ - MenuItem(title: "Start Animation", onSelect: onStartAnimationToRouteButtonClicked), - MenuItem(title: "Stop Animation", onSelect: onStopAnimationToRouteButtonClicked), - ]) - } - - private func buildTripToNYCMenuSection() -> MenuSection { - return MenuSection(title: "Trip to NYC", items: [ - MenuItem(title: "Start trip to NYC", onSelect: onStartTripToNYCButtonClicked), - MenuItem(title: "Stop trip to NYC", onSelect: onStopTripToNYCButtonClicked) - ]) - } - - public override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} - diff --git a/examples/latest/navigate/ios/CameraKeyframeTracks/README.md b/examples/latest/navigate/ios/CameraKeyframeTracks/README.md index 119a5b24..e7c78ac5 100644 --- a/examples/latest/navigate/ios/CameraKeyframeTracks/README.md +++ b/examples/latest/navigate/ios/CameraKeyframeTracks/README.md @@ -1,4 +1,4 @@ -The CameraKeyframeTracks example app shows how to use multiple keyframe tracks for map camera animations and how to animate to a route. You can find how this is done in [CameraKeyframeTracksExample.swift](lib/animations/CameraKeyframeTracksExample.swift). +The CameraKeyframeTracks example app shows how to use multiple keyframe tracks for map camera animations and how to animate to a route. You can find how this is done in [CameraKeyframeTracksExample.swift](CameraKeyframeTracksExample.swift). Build instructions: ------------------- diff --git a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles.xcodeproj/project.pbxproj index 8e4853a1..beb845e6 100644 --- a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles.xcodeproj/project.pbxproj @@ -3,29 +3,28 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - C81C80EC28735FF60074166F /* custom-dark-style-neon-rds.json in Resources */ = {isa = PBXBuildFile; fileRef = C81C80EB28735FF60074166F /* custom-dark-style-neon-rds.json */; }; - 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 */; }; - C8553C4D25B2294800E95722 /* CustomMapStylesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8553C4C25B2294800E95722 /* CustomMapStylesExample.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, ); }; }; + 83C066BF2CC80307007A890F /* custom-dark-style-neon-rds.json in Resources */ = {isa = PBXBuildFile; fileRef = 83C066BE2CC80307007A890F /* custom-dark-style-neon-rds.json */; }; + 83C837BC2C207F340004F54E /* CustomMapStylesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* CustomMapStylesApp.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 /* CustomMapStylesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* CustomMapStylesExample.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; @@ -33,74 +32,78 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C81C80EB28735FF60074166F /* custom-dark-style-neon-rds.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "custom-dark-style-neon-rds.json"; sourceTree = ""; }; - C827C53F2329371C003AA0C5 /* CustomMapStyles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomMapStyles.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 = ""; }; - C8553C4C25B2294800E95722 /* CustomMapStylesExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMapStylesExample.swift; sourceTree = ""; }; - C88C019123CDFDD500043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C066BE2CC80307007A890F /* custom-dark-style-neon-rds.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "custom-dark-style-neon-rds.json"; sourceTree = ""; }; + 83C837B82C207F340004F54E /* CustomMapStyles.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomMapStyles.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* CustomMapStylesApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMapStylesApp.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 /* CustomMapStylesExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomMapStylesExample.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 */ - C81C80EA28735FF60074166F /* assets */ = { + 83C066BD2CC80307007A890F /* assets */ = { isa = PBXGroup; children = ( - C81C80EB28735FF60074166F /* custom-dark-style-neon-rds.json */, + 83C066BE2CC80307007A890F /* custom-dark-style-neon-rds.json */, ); path = assets; sourceTree = ""; }; - C827C5362329371C003AA0C5 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C81C80EA28735FF60074166F /* assets */, - C827C5412329371C003AA0C5 /* CustomMapStyles */, - C827C5402329371C003AA0C5 /* Products */, - C88C019023CDFDD400043918 /* Frameworks */, + 83C066BD2CC80307007A890F /* assets */, + 83C837BA2C207F340004F54E /* CustomMapStyles */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C827C5402329371C003AA0C5 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C827C53F2329371C003AA0C5 /* CustomMapStyles.app */, + 83C837B82C207F340004F54E /* CustomMapStyles.app */, ); name = Products; sourceTree = ""; }; - C827C5412329371C003AA0C5 /* CustomMapStyles */ = { + 83C837BA2C207F340004F54E /* CustomMapStyles */ = { isa = PBXGroup; children = ( - C827C5422329371C003AA0C5 /* AppDelegate.swift */, - C827C5442329371C003AA0C5 /* ViewController.swift */, - C8553C4C25B2294800E95722 /* CustomMapStylesExample.swift */, - C827C5462329371C003AA0C5 /* Main.storyboard */, - C827C54923293725003AA0C5 /* Assets.xcassets */, - C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */, - C827C54E23293726003AA0C5 /* Info.plist */, + 83C837BB2C207F340004F54E /* CustomMapStylesApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* CustomMapStylesExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = CustomMapStyles; 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 = ""; @@ -108,14 +111,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C827C53E2329371C003AA0C5 /* CustomMapStyles */ = { + 83C837B72C207F340004F54E /* CustomMapStyles */ = { isa = PBXNativeTarget; - buildConfigurationList = C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "CustomMapStyles" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CustomMapStyles" */; buildPhases = ( - C827C53B2329371C003AA0C5 /* Sources */, - C827C53C2329371C003AA0C5 /* Frameworks */, - C827C53D2329371C003AA0C5 /* Resources */, - C827C559232938DA003AA0C5 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -123,98 +126,77 @@ ); name = CustomMapStyles; productName = CustomMapStyles; - productReference = C827C53F2329371C003AA0C5 /* CustomMapStyles.app */; + productReference = 83C837B82C207F340004F54E /* CustomMapStyles.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 = 1030; - 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 "CustomMapStyles" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CustomMapStyles" */; + 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 /* CustomMapStyles */, + 83C837B72C207F340004F54E /* CustomMapStyles */, ); }; /* 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 */, - C81C80EC28735FF60074166F /* custom-dark-style-neon-rds.json in Resources */, - C827C5482329371C003AA0C5 /* Main.storyboard in Resources */, + 83C066BF2CC80307007A890F /* custom-dark-style-neon-rds.json 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 = ( - C8553C4D25B2294800E95722 /* CustomMapStylesExample.swift in Sources */, - C827C5452329371C003AA0C5 /* ViewController.swift in Sources */, - C827C5432329371C003AA0C5 /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* CustomMapStylesApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* CustomMapStylesExample.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; @@ -233,18 +215,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; @@ -259,23 +242,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; @@ -294,18 +278,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; @@ -314,58 +299,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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 = "\"CustomMapStyles/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CustomMapStyles/Info.plist; + 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 = 15.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 = "\"CustomMapStyles/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CustomMapStyles/Info.plist; + 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 = 15.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"; }; @@ -374,25 +371,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C827C53A2329371C003AA0C5 /* Build configuration list for PBXProject "CustomMapStyles" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CustomMapStyles" */ = { isa = XCConfigurationList; buildConfigurations = ( - C827C54F23293726003AA0C5 /* Debug */, - C827C55023293726003AA0C5 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "CustomMapStyles" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CustomMapStyles" */ = { 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/CustomMapStyles/CustomMapStyles/AppDelegate.swift b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/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/CustomMapStyles/CustomMapStyles/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/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/CustomMapStyles/CustomMapStyles/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/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/CustomMapStyles/CustomMapStyles/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Base.lproj/Main.storyboard deleted file mode 100644 index 656a6fdc..00000000 --- a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Base.lproj/Main.storyboard +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/ContentView.swift b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/ContentView.swift new file mode 100644 index 00000000..93eef7e3 --- /dev/null +++ b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/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 customMapStylesExample: CustomMapStylesExample? + + 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: "Load") { + customMapStylesExample?.onLoadButtonClicked() + } + CustomButton(title: "Unload") { + customMapStylesExample?.onUnloadButtonClicked() + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + customMapStylesExample = CustomMapStylesExample(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/CustomMapStyles/CustomMapStyles/CustomMapStylesApp.swift b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesApp.swift new file mode 100644 index 00000000..9e373dec --- /dev/null +++ b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesApp.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 CustomMapStylesApp: 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/CustomMapStyles/CustomMapStyles/CustomMapStylesExample.swift b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesExample.swift index 27f8ed9d..24896dcb 100644 --- a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesExample.swift +++ b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/CustomMapStylesExample.swift @@ -22,19 +22,28 @@ import UIKit class CustomMapStylesExample { - private let viewController: UIViewController private let mapView: MapView - 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: 200 * 1000) camera.lookAt(point: GeoCoordinates(latitude: 52.518043, longitude: 13.405991), zoom: distanceInMeters) + + // Load the initial 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))") + } + } + func onLoadButtonClicked() { loadCustomMapStyle() } @@ -45,28 +54,35 @@ class CustomMapStylesExample { // Drag & drop the assets folder including the JSON style onto Xcode's project navigator. private func loadCustomMapStyle() { - let jsonResourceString = getResourceStringFromBundle(name: "custom-dark-style-neon-rds", + let jsonResourceString = getResourceStringFromBundle(filename: "custom-dark-style-neon-rds", type: "json") // Load the map scene using the path to the JSON resource. mapView.mapScene.loadScene(fromFile: jsonResourceString, completion: onLoadScene) } - private func getResourceStringFromBundle(name: String, type: String) -> String { - let bundle = Bundle(for: ViewController.self) - let resourceUrl = bundle.url(forResource: name, - withExtension: type) - guard let resourceString = resourceUrl?.path else { + private func getResourceStringFromBundle(filename: String, type: String) -> String { + let bundle = Bundle.main + guard let resourceUrl = bundle.url(forResource: filename, withExtension: type) else { fatalError("Error: Resource not found!") } - return resourceString + return resourceUrl.path } - // Completion handler when loading a map scene. - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return + 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/CustomMapStyles/CustomMapStyles/Info.plist b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/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/CustomMapStyles/CustomMapStyles/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/ViewController.swift b/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/ViewController.swift deleted file mode 100644 index 982e7dcc..00000000 --- a/examples/latest/navigate/ios/CustomMapStyles/CustomMapStyles/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 customMapStylesExample: CustomMapStylesExample! - 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. - customMapStylesExample = CustomMapStylesExample(viewController: self, mapView: mapView) - isMapSceneLoaded = true - } - - @IBAction func onLoadButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - customMapStylesExample.onLoadButtonClicked() - } - } - - @IBAction func onUnloadButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - customMapStylesExample.onUnloadButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers.xcodeproj/project.pbxproj index feae1ef2..4d51f22b 100644 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; 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 */; }; - C8553C4D25B2294800E95722 /* CustomRasterLayersExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8553C4C25B2294800E95722 /* CustomRasterLayersExample.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, ); }; }; + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837BF2C207F360004F54E /* Assets.xcassets */; }; + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 83C837C22C207F360004F54E /* Preview Assets.xcassets */; }; + 83C837D12C20EFA70004F54E /* CustomRasterLayersExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* CustomRasterLayersExample.swift */; }; + 86D2C6FB2CCBA2BA0060CAA8 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86D2C6FA2CCBA2B30060CAA8 /* ContentView.swift */; }; + 86D2C6FF2CCBA3240060CAA8 /* CustomRasterLayersApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 86D2C6FE2CCBA3180060CAA8 /* CustomRasterLayersApp.swift */; }; + 86F767F92CCBC58B006A22E8 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 86F767F82CCBC58B006A22E8 /* heresdk.xcframework */; }; + 86F767FA2CCBC5AE006A22E8 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 86F767F82CCBC58B006A22E8 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* 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 */, + 86F767FA2CCBC5AE006A22E8 /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,64 +31,68 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C827C53F2329371C003AA0C5 /* CustomRasterLayers.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomRasterLayers.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 = ""; }; - C8553C4C25B2294800E95722 /* CustomRasterLayersExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRasterLayersExample.swift; sourceTree = ""; }; - C88C019123CDFDD500043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* CustomRasterLayers.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CustomRasterLayers.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 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 = ""; }; + 83C837D02C20EFA70004F54E /* CustomRasterLayersExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRasterLayersExample.swift; sourceTree = ""; }; + 86D2C6FA2CCBA2B30060CAA8 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; + 86D2C6FE2CCBA3180060CAA8 /* CustomRasterLayersApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomRasterLayersApp.swift; sourceTree = ""; }; + 86F767F82CCBC58B006A22E8 /* heresdk.xcframework */ = {isa = PBXFileReference; expectedSignature = ""; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C827C53C2329371C003AA0C5 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C019223CDFDD600043918 /* heresdk.xcframework in Frameworks */, + 86F767F92CCBC58B006A22E8 /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C827C5362329371C003AA0C5 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C827C5412329371C003AA0C5 /* CustomRasterLayers */, - C827C5402329371C003AA0C5 /* Products */, - C88C019023CDFDD400043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* CustomRasterLayers */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C827C5402329371C003AA0C5 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C827C53F2329371C003AA0C5 /* CustomRasterLayers.app */, + 83C837B82C207F340004F54E /* CustomRasterLayers.app */, ); name = Products; sourceTree = ""; }; - C827C5412329371C003AA0C5 /* CustomRasterLayers */ = { + 83C837BA2C207F340004F54E /* CustomRasterLayers */ = { isa = PBXGroup; children = ( - C827C5422329371C003AA0C5 /* AppDelegate.swift */, - C827C5442329371C003AA0C5 /* ViewController.swift */, - C8553C4C25B2294800E95722 /* CustomRasterLayersExample.swift */, - C827C5462329371C003AA0C5 /* Main.storyboard */, - C827C54923293725003AA0C5 /* Assets.xcassets */, - C827C54B23293726003AA0C5 /* LaunchScreen.storyboard */, - C827C54E23293726003AA0C5 /* Info.plist */, + 86D2C6FE2CCBA3180060CAA8 /* CustomRasterLayersApp.swift */, + 86D2C6FA2CCBA2B30060CAA8 /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* CustomRasterLayersExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = CustomRasterLayers; 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 = ( + 86F767F82CCBC58B006A22E8 /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -97,14 +100,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C827C53E2329371C003AA0C5 /* CustomRasterLayers */ = { + 83C837B72C207F340004F54E /* CustomRasterLayers */ = { isa = PBXNativeTarget; - buildConfigurationList = C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "CustomRasterLayers" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CustomRasterLayers" */; 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 = CustomRasterLayers; productName = CustomRasterLayers; - productReference = C827C53F2329371C003AA0C5 /* CustomRasterLayers.app */; + productReference = 83C837B82C207F340004F54E /* CustomRasterLayers.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 = 1300; - 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 "CustomRasterLayers" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CustomRasterLayers" */; + 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 /* CustomRasterLayers */, + 83C837B72C207F340004F54E /* CustomRasterLayers */, ); }; /* 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 = ( - C8553C4D25B2294800E95722 /* CustomRasterLayersExample.swift in Sources */, - C827C5452329371C003AA0C5 /* ViewController.swift in Sources */, - C827C5432329371C003AA0C5 /* AppDelegate.swift in Sources */, + 86D2C6FB2CCBA2BA0060CAA8 /* ContentView.swift in Sources */, + 83C837D12C20EFA70004F54E /* CustomRasterLayersExample.swift in Sources */, + 86D2C6FF2CCBA3240060CAA8 /* CustomRasterLayersApp.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; @@ -248,23 +230,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; @@ -304,58 +287,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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 = "\"CustomRasterLayers/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CustomRasterLayers/Info.plist; + 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 = 15.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 = "\"CustomRasterLayers/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = CustomRasterLayers/Info.plist; + 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 = 15.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 "CustomRasterLayers" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "CustomRasterLayers" */ = { isa = XCConfigurationList; buildConfigurations = ( - C827C54F23293726003AA0C5 /* Debug */, - C827C55023293726003AA0C5 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C827C55123293726003AA0C5 /* Build configuration list for PBXNativeTarget "CustomRasterLayers" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "CustomRasterLayers" */ = { 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/CustomRasterLayers/CustomRasterLayers/AppDelegate.swift b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/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/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/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/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/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/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/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/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/Contents.json b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/Contents.json index 1d8ce251..f46a3fc8 100644 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/Contents.json +++ b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/Contents.json @@ -1,23 +1,21 @@ { "images" : [ { + "filename" : "poi_texture.png", "idiom" : "universal", - "filename" : "poi@1x.png", "scale" : "1x" }, { "idiom" : "universal", - "filename" : "poi@2x.png", "scale" : "2x" }, { "idiom" : "universal", - "filename" : "poi@3x.png", "scale" : "3x" } ], "info" : { - "version" : 1, - "author" : "xcode" + "author" : "xcode", + "version" : 1 } -} \ No newline at end of file +} diff --git a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@1x.png b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi@1x.png deleted file mode 100644 index c288ce06b7b008863543211c557fdc54b4a2d272..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2791 zcmY*bdpr}||3^_YcXCOLl!$F^VK&zxcb3Zvp_xm}uxVSlE9DZ>=1#Tplwv7zzfCNc z;z?5Odq_i~TBAt5)ARhE-}if7ug^K3^EvO&`~CTx*ZJe5ySdnjiYSWk@$re;pFkja z>k*!T_6qT4L}d6g-olSZ+F9|@2bC6i8{w!Er|^7y`=ob_pRc%7o(DJ;=7A!hoSmR( z92OK9ggc7?k+4xbG#?*~1m(F{3?UFm!bU{mp(ME4Zv>R*?}Wi>z~2x;I9v_o>;|;P z#bAJjAOjFY%}fLc1j1s1f}u!+?LXWCMG6eh#pu^ zPlt!l!IL8ifh3(s{Gq=|{*MQN!J}isq6lHQNZ<}{;8|QO0j{RDBlPe1yG}w_@c%1C z;{R!j*C2T31gr~!fdA#@rNVZiP}i6+3{QE7-%J5_M|rK9 ziNL`BUYnVSQdwSS5PH{*B9o%bUOV|4$br+g znmPw%B4-}WtrDj<*QR~OFXA#U7QbF^Wy4fDIItn|Ao-C@1yT!>^hTnRVs6=8cnDG9 z-@%-19a0%W_qX>(5c|t7>FLYmw#Bpkv`)p|bWmTRUZmx%t$AVx>z%29x)>WDs6Cl1NN=zXUPv8%H?yu?M%0JIIO-6IQgzV7mc=BizoFP z8`VrqJf0(qsy(*_9bMD#R@`S$U4k{=m=8&@xi;fQ6;_R#kyAw?G*9m8Ck4}nzYs6D z@1i6_a%uUPzJWVk%O)Hj+{}P@X5xy9B}!pDoop&x13>@yfHT@4PHq%LEzZjJuM6-Y zL%o##h@PuBzjqiCXP~JwU@*OE7TAVgc3f;TH-{@2>$~EFJbJ9f4M{{gl+Vra@)d+C zQ1yjED(!l2OWIl;viw1rkw10f8D{+NVo=!Cod@c0v3n|&JVLJfvEuXdGW zt$e%JyQuTQq0X;uPzN~+>HZh1tHp!Adf`@k(EwEo6Z3a%s-gF1s#1V5mRGAOJ!Nmc zCoZ`gMf~aI=HF0MpKf_Y=7@Z|@ulEKzQd{}2e=A8IX>}<-I%2c7i-&zB%N`9+{kiD zs7G(ICNvl_Ti1XC$c@si>;vNaXJiDkBmqRGFDdETRv7@NEFtIM%_GLAL%b9 z`H6gc>D(v_-~?14gZ2Z^fQ*GbQ4)mX+EV^up)#@Q4olKocM5t2+Tdp=iq2fG(H33N zVrC}kvvMswhg|L#zlR5yGbj>)Ha%0cRwcXaOip!;h=|8+$q^M?n_rdx2tszw<63PU zdC>PU4XUYZ9D^DWP;&8-oY~D(z?;_f;Tveam#Cd;-8fne)ue$njx-1_(l@f|OJZjX zmMA{A6nxkHicDt_HaxC!jf~R8KIazbQFKlOxSb#`zH7+M=?u1?XqGHaZ@$$++MQ*4 z*?n>*N`D%aVHJo}&8mH@lG>u8YAY%04Mc~p2yBOzG#?D$KXT`ERSd--Dz-C#e|A|E zqNK6WwHsk!oX6E)_lJ4yDc>KF!8zgAzrWr>w9$s&5os`H+Zbb(f2>sMu0vp7Pr>Vs z{c(dq^^Wg{Yf`C>PS$4>1z&VE+1o$(wU_KNAcp20kfnN$M!VIy>#I9ghx2~1 z;iry|*=1tSgdq3I*U2C3_f!KvMOo+*S4&?w<4fV9V3H(^P0M}a_aZAg8zu<9{KHB9 zFm@n0**{D&U^eBO!tAHXrlAGXP4HjFKNnbM9n};yID&jZyvKc58p}9>mA1AO^H%zm zFG1FUTpU`aq<)`gbPYFc-?QAUuVXRde4xgrB-nLk9U>K~-AQ>pNIUHdRRr#XK9 zkQM+w8EoEu(flp;l(N|fmi&ETD5bvMj^6_f{IEQgsqvYS>d>~alz@K;_jlv4r*_*W zoIEqLu3qh=p3)^JWwlVay2W<;b9^JVhGlxF%i{b86k;s*!rDwu1jMC$iHQ>vlc9Lj zp$!kiE2W#i7*1n5;)8YtwHjY~95;$q`l|r)^<`pncy}0TBP32U(fQ4b$}~2tE^Zq2 zjBqo}(yjj06z6vA_ul4j(;*l1ZhbvI`INbLWh~?qYtvMy><`&QWd38zH!rSr`njU+ ze73pe!u?jVZ8kRhYj$xx)UodAeDdt++CKB>d6{=ldhqp;Sh0Mtsl;)^(X;xb-XAYkB~&D{CwuWu%f4178J3KbY|(*;XqCj)AU6+cHM%K7pCwV~iWro>b ztmmHjdFkD{B#{op+MGkp`Q}^q>4cmfCVD6~R!1DJViE$r+667gmmfvD{9prQ>l
)24N6ykpz1;oO<6R~2)s?ZTtN6NdiZ(eV$ZV{5g{ n$T(}{-l=zw)Zc)-;UPPQ6s{q#|HoaL>lVK1`ngwL%hJne(1j|8dg6HXr2aY zN`R_i#+`=+o}0R zmGQ8%moiXR{ZIMBN|xQx%gap)2t*(d0tgWSxQ7E!NK#S~C@2gR7Uq9I@O%2XdRhDO zyLxi`o8*6Zl%bxs9!_pvPHRpXLEzsf zKp_D^;D5OvN@f0LrF1=i>Xyl8wY2oL_q~d>cnCYjR{@C=Cjm4yaF%S)#JiUvvZ+@8bLvlaZ zPb0jjp%#bl8G2r4Z)9wETy-fHAs(7mX5xH>VT#2EJG^?m5TVjXuN0u^;XRf*Y;=$I zF4#=R1CaJo9abX@dpmV!XR30JQ_}XufA)_4oX=Rjy7j(HrcBN)EGbPY0Y`JF)k*k{ zGSCq0&6uyhK^<1 z7bY4+D=WP<8Kl6%GNYskSf6*XsIk{}#{GgrY_h(s&))!_c_N;8m^et$LBaW z44)>V49|zd8`Sv{`wu+BB2=5?+ZPPU&aXA84Ouc8Op4N4Z~~qs=J!;=HdL zDQ~3ts@S&1_9wr2`~^ji_%z~I6l3EwF{?02MKpxSKJdu0?`}PYsz3fV9Bw{PWDA_a z!a|-+8nC@IckENb!D=AiKTgdQO^E=m(2T1bX&1eb2{MbS%AsCs?l8c+q-o!}Q*%b0 zSw%@7X=UUqHckQDAWxy=L#KaO4{Hm_sX6rMd>&gON7+{p_v#WC{uV|}O6lpnJt^#Y zw(%jDm5@N(p(-9W zUp;xy_RH?dL|#wn4bzgK&`Nw*8fDHWJ9cg(L_%Vp`Mfgx^y7~&x!&S1|Cz+1Y=&W< zoJ!AqE2ZgPOB=Ugg>v+%&wjpD9Pb!Ztd|?l2kF9torGFG9H12f7*{?ivS?Y`%wRI8 z5_y5>6`qMhOARfQ#2S5Ka+bH2*7N(mFCk_=XbSrc)q-gg@E$cRG9j)eDf`@mA#WIC_BgK+b|XM;T}ZPrX-I2UQBPzDq`>hEzI6=5fD@vW^=jL247yH zZoa{97z-*Aav;`vKlBz(e&)hFaoQ?ZVO6tcBLpQKo;4Zq)30aKrp@5Hk@l=+rWwS;c|S=6ySClXNJ6EasYVhD(#^^`FG!5f z!c62%x|f?hTlx6?zJD$=s-|JC>sQUr`yE$+()d9?FVV!#EY2-QloxOj=M9!m9MR!O zCbymb8u5<{i$&-Rp&~=l{g??w!FmfTNsg50o{g^c<^GQ0?naAT zM(XDxG1nX5#-}0&zHiYIwX33U_j=)Qq_po|JJ$wq7CIFiItut}@TwMhmtv)n`fuS2#$hHTL?q0+F=u=!=EmBXMuj9T}zsk={4lBad-MAxVQJ zJG?x&N?WNuR$Kg>&*+l{1LPrj2lHP(8O@)X-<=8je&>`zK|^>uU(3mbtpxjJCN|vi zpWNh(cQsV72nvL<^|Z9k?2fOOk1yX8!CKKXP%F`Zmzl#cYyi{1=M^V|^hm)tqK?QA z_qNgR8)TEH7J*#+1ErTPI}`bxiRq&kU8?dvwK43J2&c}k6u|0{F8rhvL(+YDYQ6+>koO_ zc^4PF^*KR1x^yp$pagW_Ad#K@tbT)UjM~jcLOhJpIZdrv;ohpMN%N&;ur`4DWn=

Y4&!YigM*ewcaQv=@V5&N*JZpniYyUSBM08H+92vvQcFG zRs@i3A@wc|%c2f9^F&2MBYIb3aFgGr2Q^p*I(`vS6yz3i{uP%z8mw@<;cBqo^s>DP zFHD3C7u~z+y9~C8-B%~Y)SZ6qk1Fqz1hpcfR4lXTMRU{Daj_#9Kq+ms7Vjchwy||R zuZM4+^#wKgUx)YFk151cRU{^miaOIDFyq8fkBSBqbZa%=*x7#9`(O}5WD22j6cwvu zD>LhnBdGR>r#;E->R(Fnt;_G8<(n_7ah!%+YtyA{vYz}HG@U(3!FMDXmKbxH41H7& z;~+07!xX<|!wRv!%=MYnV*ME)sasK+Kq%2*VxVK}WuwWsA4rDAkDCI3am3|iZHPnA zRmudVA1O*HM3sLt*c@xZ=Dr!!-rN`F7d#_aixLp9Kl8DXGy1W_K3evM&I$YAN$caL zAqvanE*?NdWn4_nt#3f@&N zzat){rAhL(SkIB@=2G@4B-fd$=}_?IrDcv8aMh@E$AZux84eJ!ISLuO;w&(KQ?uM~ ze+|Za3a8?aHc0P9_(P$z6ruJwb4%!}MLQfS_1CN4M%cxiaO6u`KX!%-X5T7oQVThI z^P2T{NA;F``($BJe6BPSMEa?~^1U!1D%pL!R`IW@9rtD)G)xQ+VBRn|#r>IVZSKde zU3%uvP;9pMx4A(!&LpyzHDLN-!V>M+7m3q^ql12kK|9LCMjIbf?oo8t*bIKuJLc_m0~@#Zd|m=DA{UcxKHO3kI~Z7XL=;)7Kab`M>b zThs!tem^A+Fcz?k_VuwNGoBuxmSV_Pjf&96(J7Q1`Q^nWqI^5Hb4Ln-O&7i?`T2;W zN@J#W`F@qZvC^A}`l;4;s$rf)Lb2iVr~~Qcv?T}dd#IQfNrMd~_hg+tX>MGp0q_3z zw(XpCB({k7iyu40OKMfv_|oPEIvtxYOKo<3_!ozZS6hY#tTSXr1~k zlj60;+#5C`mIX9p_*u1HlM~sL#Jn+eqR1Ff`!?A1HBmn@B88XUYaXsvjPJD~ku&BE zu}q7Jl8b zK45XU13Sm7qeI+wm_Q$rQVO^`kjsUk;VrRY3O>xo?9>lFl9_QaIx~c__oofzlj4Sm zgl8$JcS@M1{SN zf4Kk&rU~+5gG_>AC({KrqGF#M)LS`LLuCmhc6}g zQ#1l5)7T8D9q<5Z#E?CS@TPX~UHUizWs#^a78qX=*E$s&8(QF;!euxaY9Soh&Cz~5 zbmQ%^yUzgDP14!NW+v#}$OA+|1rBvrocHv~>TmTCeHbI}t9}&BeJe~tTLosaKEC&w z1~<{&SL*nf>Y1Yw)4^d{$IX1#e#m>yfq_H$bhiQqBqV-EGC|HC)Us86mtRKrTY>u` zG$-a*oqk7w&MRV~9?U_@iTlkdki`@$flH$Y9%k~+=iSD9oy#h|yij2^^yeGV^H1gYd zL%-)@)>gqEP0dy>{r7wAxuv9-5#{Aa%p@j*0fz!~-At;YZrNp3%d9$Cs63?};piwQ zQfUHDOW$0l>Z=V^AKMt^ESC|}YGHOVTkF8U0*hW<>Q&a?F4MbHn>pC#E4i9uGf2MZ${GUfWbI=kO75PDeMeDMWNA zB%C{854{5XSW0K#v%GOp=VB;ILT5;L^EizO!k3LV&k$)@3$DzmGPu*Uh&pFwSV9Im z&zpY08j>O&+T9MEUuxO>qq@xp8c69ezX(a{Ru~PouQbEbp5Tqu=5Qn=s0q;7C8+0N z|_vm@>jGINNg{Ur+_PviI9fr(;2ML^_ck-2Q{9`@QU1$xRW|>|2~}4_TUOXKN!o|N z;iV=agX$;qvs>>5Wpk7{1`eY!13W&sCF?3qJc<>D(@kDM(eWUmGOgCaC!)Ji6%6*L zv~dyPAi}Xa?=Ng<_vG^11pxddWzJQzKFs4OZP}?qCIRM5Z*8YM-o+xOTwtlpD zYy`hk(@(eMgP1)NH;8p>_232|Mp!87I z3+gXjI>&9f1PiZ=UjB`W@d!7iXFAQx zrJJyquGdMOBuEOr8;a1|>kr~bKuVF%Hq1UF$n0TpoLW1xDfsn#F2|{@1T^*Rxmu9! zkt{<8hMUnH2gwog+1Az`d*8b@fxCooXPGI>OV5zBn9}Fq*<3{D+ktZMYDqUEh7#dN zznrwn-1l)P|6V1Wa=ENKx4k4xh*jVmnl0}@m{Y2RQF&98!JAYsweQy$3hH?KPt{wh z;N`A^`1Ahr48Fdz1^@s6b{rlF00006VoOIv0RI60 z0RN!9r;`8x010qNS#tmY3ljhU3ljkVnw%H_000McNliru;RzWC8!V(S?jisH5_d^N zK~#9!?VWjW9Mzr2zrWYrbL$uh%aUzu%Lg_`k%Xi|FdI@_#uzYLwF%k4)>bxQ6IC`WXq>6%Nj{DqnYXM_kR1w7#U+r z)-gwq+`lSSscL%Wb^kv7{r!ILb-(wBnc-UDn{Zv=f^^M6rWfjoQ+=)1u%^#cWS>pU zXOU9VVXMI-U63O*@4fe)tw1*t^Bgcw2eSqtz`;QJ&*ufa9I;0*EAtb~52P0sJPlV#TK}$ibe_nl+WWlsAy#9{_Y7 z2*kkvxF`q?1;N2UT6NhpW>CBr6pMqR@ibUwKo>h$XiwRJz^}QcX1@#a1m;=2`dei4 zzcKg^m6rmVhJr9DAr5yzw08iO1!&?!29{VWR=jpffTX&$6^7Sd55?by;Ss9xG^p}$ z_VZpA^Qkx-foSajEQ{G^JZszDpYkmWn@1%`0!XZTV7Zn`+ytpkASW?kH4_a;~Ks#R*#fTVTn#v2LqDL~EQP!Q_$@s7=bnaH7H|3OeJ4ruzj zmM*@>H{ZOs;6dv5-S_vxG#`Nw<#NI}a9Jr%1*5}V&%Km zp(a$Nhs#byQwrih3&i0FAjCE+mAr~qt?F?+NV@BRv4%+eFPP4ir;h`dm%=rqyDIye z0UXEz< z&m}gHzYU*C7z=#TLO6l=?Mn@09$@jP8bwh1!=5Z ze+g2l@2N56;Nl|J`I(Ne#UZFM8>EOQmO;ugHP%&QURBAmRCv9M zhYeCQlRsv^&wa9y=RpGY`=BL~Hx3J=v3}!)kZLlQm$}}|H_Y;~^w8ag4YP&}l9c%` zAc6`PyPnK_ckFRWkFo0 zXlaLNJH(c!tb%X;NymVpRpahCU?vU~M&I$es&UwP(IvQR#+ieL2mloxFYcLfCbnO6 zF}_<_7!LzD6abh>^Q5jgX^s>YUknnCACe;gtESJu<6r$c#`}hUuBZF_c=BuCz}+*> zgmC!u_w>><0>ZK`K6#E*@_Y{X96b$A5aF?}oQLbG#%1iLSTSW9Ci?@p;o}dWoSHj@ z0QFyNhpRFO*!Hw9_a~2)T{tim z%pN#+e*bk<Ms!a9p_OSS0I=7Yid-^z3QqTB|1E{_J|7lNs&=j-0g%lz`v{$W^HRE?hRGe&R@Ntk;VR zO2ZE9cM;fY0E(v!)Q>E6>eG&SV=GUIHV0+84k%SRfFhOOsV^VT%7Z#)IZ=^E`jY?$ z`Ufc~;M9SDDS_NCE-^LW&;>0t0Wkaf2TAN_;ml#Gl01a`QiskqV<7;hz(6_D58=-1 zaJ&f(fbtJiwff*tMRwbE&fDy=EQf+59Nh-v#EN9VnFGeVdgD27voQ~C4l=j`bS$VZ zX{3+~?4khR~xqj4wxGY^H;pbMR33Sb69 zeb_HZjgs%AZ~dgB2R44$umexFWPX2?Ct41ou5qWMubmR{)xTW@XXKeVQIjro}32{_#tKwZNQ zT=(I7*qaPzd&i))vfo zbt_hE{|s%Z!S^%UQYqZB{WHvbZL6bm;xT3`P;UYZaok2~`thR%@{b^K8%3k(v>+$0_%^4xysJ~<{lK~0FsD;b4XFZ zpq>~A{AWJFx^v>hRiXVDY#S7fxejznSnY`dwhfu+ef&h9pAe+IYSoJ*xltVIbUo-0 z6CDwdR6Fdu?s{d=Aeot!;KwK$OK&^tT7J#4K+zbKM*q(JEa%zpD|2>l?9;*$iw{}({FCQ^UgL(Sx<_NPR9_y{;|^F> z!p)U=RO6w;fN3Q~^PzhOJZ_*56Thx+BB`Dh?S~3xq-Ru_tsvSvK+=9P`N)Hf!v+Ze z6id~?mML+l!*y(~)!2Rruw{zkvD;62?8y#DuD*R2F+VO29d;|&99OEMqZ6dmW69O4 zca0b%0C@N9{TVE)UEAN{IygtB?Qa1r`;e#mz{)|XcQ6O_Jp6D6K)<5y9#B`0>*XvP zMY=)VJpjvJM%O&lKB(^uc9SzABIEWu--5?D-#+t9?}gkWaZoTDhS%9?QeGU+ja#9F_nULpcxS2ZJVuM4f*@S*$9+2 zZys+%x;|mACoE@7b@Xy)1!2t4cI*Nr%q~mAS9ryWeM1h(!)kZ_{DaEx`w1mYrR{g~ z<%qi)`woJVDX9Y99}frOut5TVy=2MLY-p>gvkRi_kV|8@#Z7BFsIv!W&7fG^ zr88KFu{gB72LWCGi(OoF-H3mWGw^~HZQ4|6M5FJ3Xri1}4febHXbtGEL=swK6PW3s z9W4JQFZ|Jn3yqAFn_N@VYWaM#p}1XZYyu^cF0GS5gj8*|&vR)eAZ83C0Py0)J1oEN zB35YC8k<19F3f%*Dn3L({W4y>ct^&5n=}0GDsA3yj^34gg#^moF#83+Bu!`yy8-41 zLcz<-n{N6bqt$Q5`?m9I|7w>MUBXPAT4PgsKA#IQ4N-CzihY-78e&#J0st>q@E0mF zE`{Vyt>M&$NlEiaPL$m!3C%Va)V`mU{%E!?z^qyF5z0ez!Q6eS!aN3Ipy&#-rsmzO zwZ&PU-{E=Wp>Lt1=XnTGET>mHcD?kBJ2sVq*02YVGRDE;xz?fuuV=HptdDk^H!gUa zi;J#=QqfaInMWb2IF}S(oo$FY0SN$BP0gEJ8k`44e6+(nMu{awS6K@dyqb%4bN2kn zn!oTBE(*>$s!VfqE3vfXnp{E5Daa$r+{VR4bD>mJYit6gMvpSdG@&)@1*D8~Y4O$8 z{Q0lsvi+Pt5$=O2WmId}Gdf^e7DU4yK-zIGF1jYy5c2}^c$j+&8>VGJ+t~!Nk3g)c zc{wi;f%7=M+^DbrHpS!50-^{S72H&JCIS?LnByD@&a)OS+?u!0&UtoTA55kqCV&cM z3ZD?^8;=m@P$;hu^A=iE)k5n@3qvQL>0 zK6oB_VlMz(#w0*W4pWH)0s)LJXvUT1Ez906M1K_QoN@D}n?68s=yHHMiPfq#DtzR_n0}q_b@x)6YIt_%rWxS7uQ;xtFnr$u}JrGBg zB9AKbcYo7&HOzx$wS$pXrVtW-|KwT+W<21^~3}yZT+8i-@i6 z_NM0w*$;ZbhZMm(AjMfHQsl`1_9;^1?QUpwN{+OOCPUb#5kwKdbkfU)ibClfK_j}y z&5=&LAi7vDE^aKgJ(|}mHACv;0RYWrGo?vOH)X1)XIc;Q%eGs!y5>0he>`a8gMG~? Qy#N3J07*qoM6N<$g1>e)?*IS* diff --git a/examples/latest/navigate/ios/CustomRasterLayers/assets/poi_texture.png b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi_texture.png similarity index 100% rename from examples/latest/navigate/ios/CustomRasterLayers/assets/poi_texture.png rename to examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Assets.xcassets/poi.imageset/poi_texture.png diff --git a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/Main.storyboard deleted file mode 100644 index 630a1228..00000000 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Base.lproj/Main.storyboard +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/ContentView.swift b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/ContentView.swift new file mode 100644 index 00000000..39817d7f --- /dev/null +++ b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/ContentView.swift @@ -0,0 +1,83 @@ +/* + * Copyright (C) 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 customRasterLayersExample: CustomRasterLayersExample? + + 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: "Enable") { + customRasterLayersExample?.onEnableButtonClicked() + }.padding(.trailing, 20) + CustomButton(title: "Disable") { + customRasterLayersExample?.onDisableButtonClicked() + }.padding(.leading, 20) + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + customRasterLayersExample = CustomRasterLayersExample(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/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersApp.swift b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersApp.swift new file mode 100644 index 00000000..16b403dc --- /dev/null +++ b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersApp.swift @@ -0,0 +1,72 @@ +/* + * 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 CustomRasterLayersApp: 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/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift index 554290e2..9cae5f94 100644 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift +++ b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/CustomRasterLayersExample.swift @@ -1,7 +1,7 @@ /* * Copyright (C) 2019-2024 HERE Europe B.V. * - * Licensed under the Apache License, Version 2.0 (the "License") + * 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 * @@ -18,7 +18,7 @@ */ import heresdk -import UIKit +import SwiftUI class CustomRasterLayersExample { @@ -26,13 +26,20 @@ class CustomRasterLayersExample { private var rasterMapLayerStyle: MapLayer! private var rasterDataSourceStyle: RasterDataSource! - init(mapView: MapView) { + init(_ mapView: MapView) { self.mapView = mapView + // Configure the map. let camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: 60 * 1000) camera.lookAt(point: GeoCoordinates(latitude: 52.518043, longitude: 13.405991), zoom: distanceInMeters) + + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) + + 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) let dataSourceName = "myRasterDataSourceStyle" rasterDataSourceStyle = createRasterDataSource(dataSourceName: dataSourceName) @@ -44,6 +51,13 @@ class CustomRasterLayersExample { // Add a POI marker addPOIMapMarker(geoCoordinates: GeoCoordinates(latitude: 52.530932, longitude: 13.384915)) } + + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } func onEnableButtonClicked() { rasterMapLayerStyle.setEnabled(true) @@ -132,4 +146,21 @@ class CustomRasterLayersExample { mapView.mapScene.addMapMarker(mapMarker) } + + 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/CustomRasterLayers/CustomRasterLayers/Info.plist b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/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/CustomRasterLayers/CustomRasterLayers/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/ViewController.swift b/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/ViewController.swift deleted file mode 100644 index 8b354998..00000000 --- a/examples/latest/navigate/ios/CustomRasterLayers/CustomRasterLayers/ViewController.swift +++ /dev/null @@ -1,78 +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 customRasterLayersExample: CustomRasterLayersExample! - 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) - } - - 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) - } - - private func onLoadScene(mapError: MapError?) { - guard mapError == nil else { - print("Error: Map scene not loaded, \(String(describing: mapError))") - return - } - - // Start the example. - customRasterLayersExample = CustomRasterLayersExample(mapView: mapView) - isMapSceneLoaded = true - } - - @IBAction func onEnableButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - customRasterLayersExample.onEnableButtonClicked() - } - } - - @IBAction func onDisableButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - customRasterLayersExample.onDisableButtonClicked() - } - } - - func showDialog(title: String, message: String) { - let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert) - - alertController.addAction(UIAlertAction(title: "Ok", style: .cancel, handler: nil)) - - present(alertController, animated: true, completion: nil) - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/CustomRasterLayers/README.md b/examples/latest/navigate/ios/CustomRasterLayers/README.md index 20ff3457..429588bb 100644 --- a/examples/latest/navigate/ios/CustomRasterLayers/README.md +++ b/examples/latest/navigate/ios/CustomRasterLayers/README.md @@ -1,4 +1,4 @@ -This example app shows how to load custom raster layers. You can find how this is done in [CustomRasterLayersExample.swift](CustomRasterLayersExample/CustomRasterLayersExample.swift). +The CustomRasterLayers example app shows how to calculate a route from A to B with a number of waypoints in between that is visualized on the map. You can find how this is done in [CustomRasterLayersExample.swift](CustomRasterLayers/CustomRasterLayersExample.swift). Build instructions: ------------------- diff --git a/examples/latest/navigate/ios/EVRouting/EVRouting/RoutingExample.swift b/examples/latest/navigate/ios/EVRouting/EVRouting/RoutingExample.swift index ef67a4db..ef9a40a0 100644 --- a/examples/latest/navigate/ios/EVRouting/EVRouting/RoutingExample.swift +++ b/examples/latest/navigate/ios/EVRouting/EVRouting/RoutingExample.swift @@ -235,7 +235,7 @@ class RoutingExample { let searchOptions = SearchOptions(languageCode: LanguageCode.enUs, maxItems: 30) - searchEngine.search(textQuery: textQuery, + searchEngine.searchByText(textQuery, options: searchOptions, completion: onSearchCompleted) } diff --git a/examples/latest/navigate/ios/Gestures/Gestures.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/Gestures/Gestures.xcodeproj/project.pbxproj index 08464c8f..0d69acb0 100644 --- a/examples/latest/navigate/ios/Gestures/Gestures.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/Gestures/Gestures.xcodeproj/project.pbxproj @@ -3,29 +3,28 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - C865247F20B81A8900392D48 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C865247E20B81A8900392D48 /* AppDelegate.swift */; }; - C865248120B81A8900392D48 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C865248020B81A8900392D48 /* ViewController.swift */; }; - C865248420B81A8900392D48 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C865248220B81A8900392D48 /* Main.storyboard */; }; - C865248620B81A8B00392D48 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C865248520B81A8B00392D48 /* Assets.xcassets */; }; - C865248920B81A8B00392D48 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C865248720B81A8B00392D48 /* LaunchScreen.storyboard */; }; - C865249520B83D7600392D48 /* GesturesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C865249420B83D7600392D48 /* GesturesExample.swift */; }; - C88C016523CDFC6400043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C016423CDFC6400043918 /* heresdk.xcframework */; }; - C88C016623CDFC6400043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C016423CDFC6400043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - C8EAA7D423F32DF20013DDA9 /* GestureMapAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8EAA7D323F32DF20013DDA9 /* GestureMapAnimator.swift */; }; + 830C4ABB2CBFEDA000B4252B /* GestureMapAnimator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830C4ABA2CBFEDA000B4252B /* GestureMapAnimator.swift */; }; + 83C837BC2C207F340004F54E /* GesturesApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* GesturesApp.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 /* GesturesExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* GesturesExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C88C016723CDFC6400043918 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C016623CDFC6400043918 /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -33,66 +32,70 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C865247B20B81A8900392D48 /* Gestures.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Gestures.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C865247E20B81A8900392D48 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C865248020B81A8900392D48 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C865248320B81A8900392D48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C865248520B81A8B00392D48 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C865248820B81A8B00392D48 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C865248A20B81A8B00392D48 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C865249420B83D7600392D48 /* GesturesExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GesturesExample.swift; sourceTree = ""; }; - C88C016423CDFC6400043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; - C8EAA7D323F32DF20013DDA9 /* GestureMapAnimator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GestureMapAnimator.swift; sourceTree = ""; }; + 830C4ABA2CBFEDA000B4252B /* GestureMapAnimator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GestureMapAnimator.swift; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Gestures.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Gestures.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* GesturesApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GesturesApp.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 /* GesturesExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GesturesExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C865247820B81A8900392D48 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C016523CDFC6400043918 /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C865247220B81A8900392D48 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C865247D20B81A8900392D48 /* Gestures */, - C865247C20B81A8900392D48 /* Products */, - C88C016323CDFC6400043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* Gestures */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C865247C20B81A8900392D48 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C865247B20B81A8900392D48 /* Gestures.app */, + 83C837B82C207F340004F54E /* Gestures.app */, ); name = Products; sourceTree = ""; }; - C865247D20B81A8900392D48 /* Gestures */ = { + 83C837BA2C207F340004F54E /* Gestures */ = { isa = PBXGroup; children = ( - C865247E20B81A8900392D48 /* AppDelegate.swift */, - C865248020B81A8900392D48 /* ViewController.swift */, - C865249420B83D7600392D48 /* GesturesExample.swift */, - C8EAA7D323F32DF20013DDA9 /* GestureMapAnimator.swift */, - C865248220B81A8900392D48 /* Main.storyboard */, - C865248520B81A8B00392D48 /* Assets.xcassets */, - C865248720B81A8B00392D48 /* LaunchScreen.storyboard */, - C865248A20B81A8B00392D48 /* Info.plist */, + 83C837BB2C207F340004F54E /* GesturesApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* GesturesExample.swift */, + 830C4ABA2CBFEDA000B4252B /* GestureMapAnimator.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = Gestures; sourceTree = ""; }; - C88C016323CDFC6400043918 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C88C016423CDFC6400043918 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -100,14 +103,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C865247A20B81A8900392D48 /* Gestures */ = { + 83C837B72C207F340004F54E /* Gestures */ = { isa = PBXNativeTarget; - buildConfigurationList = C865248D20B81A8B00392D48 /* Build configuration list for PBXNativeTarget "Gestures" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Gestures" */; buildPhases = ( - C865247720B81A8900392D48 /* Sources */, - C865247820B81A8900392D48 /* Frameworks */, - C865247920B81A8900392D48 /* Resources */, - C88C016723CDFC6400043918 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -115,99 +118,77 @@ ); name = Gestures; productName = Gestures; - productReference = C865247B20B81A8900392D48 /* Gestures.app */; + productReference = 83C837B82C207F340004F54E /* Gestures.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C865247320B81A8900392D48 /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 0930; - LastUpgradeCheck = 0930; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C865247A20B81A8900392D48 = { - CreatedOnToolsVersion = 9.3; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C865247620B81A8900392D48 /* Build configuration list for PBXProject "Gestures" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Gestures" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C865247220B81A8900392D48; - productRefGroup = C865247C20B81A8900392D48 /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C865247A20B81A8900392D48 /* Gestures */, + 83C837B72C207F340004F54E /* Gestures */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C865247920B81A8900392D48 /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C865248920B81A8B00392D48 /* LaunchScreen.storyboard in Resources */, - C865248620B81A8B00392D48 /* Assets.xcassets in Resources */, - C865248420B81A8900392D48 /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C865247720B81A8900392D48 /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C865248120B81A8900392D48 /* ViewController.swift in Sources */, - C865249520B83D7600392D48 /* GesturesExample.swift in Sources */, - C865247F20B81A8900392D48 /* AppDelegate.swift in Sources */, - C8EAA7D423F32DF20013DDA9 /* GestureMapAnimator.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* GesturesApp.swift in Sources */, + 830C4ABB2CBFEDA000B4252B /* GestureMapAnimator.swift in Sources */, + 83C837D12C20EFA70004F54E /* GesturesExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C865248220B81A8900392D48 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C865248320B81A8900392D48 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C865248720B81A8B00392D48 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C865248820B81A8B00392D48 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C865248B20B81A8B00392D48 /* 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; @@ -226,18 +207,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; @@ -252,22 +234,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.0; - MTL_ENABLE_DEBUG_INFO = YES; + 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; }; - C865248C20B81A8B00392D48 /* 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; @@ -286,18 +270,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; @@ -306,58 +291,71 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - C865248E20B81A8B00392D48 /* 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 = "\"Gestures/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Gestures/Info.plist; + 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 = 15.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; }; - C865248F20B81A8B00392D48 /* 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 = "\"Gestures/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Gestures/Info.plist; + 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 = 15.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_VERSION = 5.12.; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; @@ -365,25 +363,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C865247620B81A8900392D48 /* Build configuration list for PBXProject "Gestures" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Gestures" */ = { isa = XCConfigurationList; buildConfigurations = ( - C865248B20B81A8B00392D48 /* Debug */, - C865248C20B81A8B00392D48 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C865248D20B81A8B00392D48 /* Build configuration list for PBXNativeTarget "Gestures" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Gestures" */ = { isa = XCConfigurationList; buildConfigurations = ( - C865248E20B81A8B00392D48 /* Debug */, - C865248F20B81A8B00392D48 /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C865247320B81A8900392D48 /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/navigate/ios/Gestures/Gestures/AppDelegate.swift b/examples/latest/navigate/ios/Gestures/Gestures/AppDelegate.swift deleted file mode 100644 index ed116e80..00000000 --- a/examples/latest/navigate/ios/Gestures/Gestures/AppDelegate.swift +++ /dev/null @@ -1,60 +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/Gestures/Gestures/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/Gestures/Gestures/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/Gestures/Gestures/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/Gestures/Gestures/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/Gestures/Gestures/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/Gestures/Gestures/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/Gestures/Gestures/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/Gestures/Gestures/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Gestures/Gestures/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/Gestures/Gestures/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/Gestures/Gestures/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/Gestures/Gestures/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/Gestures/Gestures/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f83f6fd5..00000000 --- a/examples/latest/navigate/ios/Gestures/Gestures/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/Gestures/Gestures/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/Gestures/Gestures/Base.lproj/Main.storyboard deleted file mode 100644 index 03c13c22..00000000 --- a/examples/latest/navigate/ios/Gestures/Gestures/Base.lproj/Main.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/Gestures/Gestures/ContentView.swift b/examples/latest/navigate/ios/Gestures/Gestures/ContentView.swift new file mode 100644 index 00000000..ddec42d1 --- /dev/null +++ b/examples/latest/navigate/ios/Gestures/Gestures/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 gesturesExample: GesturesExample? + + 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. + gesturesExample = GesturesExample(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/explore/ios/CustomMapStyles/CustomMapStyles/AppDelegate.swift b/examples/latest/navigate/ios/Gestures/Gestures/GesturesApp.swift similarity index 63% rename from examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/AppDelegate.swift rename to examples/latest/navigate/ios/Gestures/Gestures/GesturesApp.swift index 5c8c8eef..30ab2420 100644 --- a/examples/latest/explore/ios/CustomMapStyles/CustomMapStyles/AppDelegate.swift +++ b/examples/latest/navigate/ios/Gestures/Gestures/GesturesApp.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 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() - - 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/Gestures/Gestures/GesturesExample.swift b/examples/latest/navigate/ios/Gestures/Gestures/GesturesExample.swift index fa642399..3e72bcfb 100644 --- a/examples/latest/navigate/ios/Gestures/Gestures/GesturesExample.swift +++ b/examples/latest/navigate/ios/Gestures/Gestures/GesturesExample.swift @@ -25,15 +25,14 @@ class GesturesExample: TapDelegate, TwoFingerTapDelegate, LongPressDelegate { - private var viewController: UIViewController private var mapView: MapView private lazy var gestureMapAnimator = GestureMapAnimator(mapView.camera) - 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), @@ -49,9 +48,19 @@ class GesturesExample: TapDelegate, mapView.gestures.disableDefaultAction(forGesture: .doubleTap) mapView.gestures.disableDefaultAction(forGesture: .twoFingerTap) + // 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: "Shows Tap and LongPress gesture handling. " + "See log for details. DoubleTap / TwoFingerTap map action (zoom in/out) is disabled and replaced with a custom animation.") } + + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } // Conform to the TapDelegate protocol. func onTap(origin: Point2D) { @@ -114,8 +123,19 @@ class GesturesExample: 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/Gestures/Gestures/Info.plist b/examples/latest/navigate/ios/Gestures/Gestures/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/Gestures/Gestures/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/Gestures/Gestures/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Gestures/Gestures/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/Gestures/Gestures/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/Gestures/Gestures/ViewController.swift b/examples/latest/navigate/ios/Gestures/Gestures/ViewController.swift deleted file mode 100644 index 36cf873d..00000000 --- a/examples/latest/navigate/ios/Gestures/Gestures/ViewController.swift +++ /dev/null @@ -1,53 +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 { - - private var mapView: MapView! - private var gesturesExample: GesturesExample! - - override func viewDidLoad() { - super.viewDidLoad() - - // Initialize MapView without a storyboard. - mapView = MapView(frame: view.bounds) - view.addSubview(mapView) - - // 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. - gesturesExample = GesturesExample(viewController: self, mapView: mapView) - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom.xcodeproj/project.pbxproj index 98aacd41..bda9dc43 100644 --- a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom.xcodeproj/project.pbxproj @@ -3,31 +3,31 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; 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, ); }; }; - C8EC2E99273343C6005175D4 /* custom_location_indicator_pedestrian.obj in Resources */ = {isa = PBXBuildFile; fileRef = C8EC2E95273343C6005175D4 /* custom_location_indicator_pedestrian.obj */; }; - C8EC2E9A273343C6005175D4 /* custom_location_indicator_pedestrian.png in Resources */ = {isa = PBXBuildFile; fileRef = C8EC2E96273343C6005175D4 /* custom_location_indicator_pedestrian.png */; }; - C8EC2E9B273343C6005175D4 /* custom_location_indicator_navigation.png in Resources */ = {isa = PBXBuildFile; fileRef = C8EC2E97273343C6005175D4 /* custom_location_indicator_navigation.png */; }; - C8EC2E9C273343C6005175D4 /* custom_location_indicator_navigation.obj in Resources */ = {isa = PBXBuildFile; fileRef = C8EC2E98273343C6005175D4 /* custom_location_indicator_navigation.obj */; }; + 83C066C52CCB9F6F007A890F /* custom_location_indicator_pedestrian.obj in Resources */ = {isa = PBXBuildFile; fileRef = 83C066C12CCB9F6F007A890F /* custom_location_indicator_pedestrian.obj */; }; + 83C066C62CCB9F6F007A890F /* custom_location_indicator_pedestrian.png in Resources */ = {isa = PBXBuildFile; fileRef = 83C066C22CCB9F6F007A890F /* custom_location_indicator_pedestrian.png */; }; + 83C066C72CCB9F6F007A890F /* custom_location_indicator_navigation.png in Resources */ = {isa = PBXBuildFile; fileRef = 83C066C32CCB9F6F007A890F /* custom_location_indicator_navigation.png */; }; + 83C066C82CCB9F6F007A890F /* custom_location_indicator_navigation.obj in Resources */ = {isa = PBXBuildFile; fileRef = 83C066C42CCB9F6F007A890F /* custom_location_indicator_navigation.obj */; }; + 83C837BC2C207F340004F54E /* NavigationCustomApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* NavigationCustomApp.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 /* NavigationCustomExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* NavigationCustomExample.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; @@ -35,93 +35,99 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C865243F20B8138000392D48 /* NavigationCustom.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationCustom.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 = ""; }; - C8EC2E95273343C6005175D4 /* custom_location_indicator_pedestrian.obj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = custom_location_indicator_pedestrian.obj; sourceTree = ""; }; - C8EC2E96273343C6005175D4 /* custom_location_indicator_pedestrian.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = custom_location_indicator_pedestrian.png; sourceTree = ""; }; - C8EC2E97273343C6005175D4 /* custom_location_indicator_navigation.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = custom_location_indicator_navigation.png; sourceTree = ""; }; - C8EC2E98273343C6005175D4 /* custom_location_indicator_navigation.obj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = custom_location_indicator_navigation.obj; sourceTree = ""; }; + 83C066C12CCB9F6F007A890F /* custom_location_indicator_pedestrian.obj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = custom_location_indicator_pedestrian.obj; sourceTree = ""; }; + 83C066C22CCB9F6F007A890F /* custom_location_indicator_pedestrian.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = custom_location_indicator_pedestrian.png; sourceTree = ""; }; + 83C066C32CCB9F6F007A890F /* custom_location_indicator_navigation.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = custom_location_indicator_navigation.png; sourceTree = ""; }; + 83C066C42CCB9F6F007A890F /* custom_location_indicator_navigation.obj */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = custom_location_indicator_navigation.obj; sourceTree = ""; }; + 83C837B82C207F340004F54E /* NavigationCustom.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = NavigationCustom.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* NavigationCustomApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationCustomApp.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 /* NavigationCustomExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationCustomExample.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 = { + 83C066C02CCB9F6F007A890F /* assets */ = { isa = PBXGroup; children = ( - C8EC2E94273343C6005175D4 /* assets */, - C865244120B8138000392D48 /* NavigationCustom */, - C865244020B8138000392D48 /* Products */, - C88C016C23CDFC9600043918 /* Frameworks */, + 83C066C12CCB9F6F007A890F /* custom_location_indicator_pedestrian.obj */, + 83C066C22CCB9F6F007A890F /* custom_location_indicator_pedestrian.png */, + 83C066C32CCB9F6F007A890F /* custom_location_indicator_navigation.png */, + 83C066C42CCB9F6F007A890F /* custom_location_indicator_navigation.obj */, + ); + path = assets; + sourceTree = ""; + }; + 83C837AF2C207F340004F54E = { + isa = PBXGroup; + children = ( + 83C066C02CCB9F6F007A890F /* assets */, + 83C837BA2C207F340004F54E /* NavigationCustom */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C865244020B8138000392D48 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C865243F20B8138000392D48 /* NavigationCustom.app */, + 83C837B82C207F340004F54E /* NavigationCustom.app */, ); name = Products; sourceTree = ""; }; - C865244120B8138000392D48 /* NavigationCustom */ = { + 83C837BA2C207F340004F54E /* NavigationCustom */ = { isa = PBXGroup; children = ( - C865244220B8138000392D48 /* AppDelegate.swift */, - C865244420B8138000392D48 /* ViewController.swift */, - C865244620B8138000392D48 /* Main.storyboard */, - C865244920B8138200392D48 /* Assets.xcassets */, - C865244B20B8138200392D48 /* LaunchScreen.storyboard */, - C865244E20B8138200392D48 /* Info.plist */, + 83C837BB2C207F340004F54E /* NavigationCustomApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* NavigationCustomExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = NavigationCustom; sourceTree = ""; }; - C88C016C23CDFC9600043918 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C88C016D23CDFC9600043918 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, ); - name = Frameworks; + path = "Preview Content"; sourceTree = ""; }; - C8EC2E94273343C6005175D4 /* assets */ = { + 83C837C92C20AAE50004F54E /* Frameworks */ = { isa = PBXGroup; children = ( - C8EC2E95273343C6005175D4 /* custom_location_indicator_pedestrian.obj */, - C8EC2E96273343C6005175D4 /* custom_location_indicator_pedestrian.png */, - C8EC2E97273343C6005175D4 /* custom_location_indicator_navigation.png */, - C8EC2E98273343C6005175D4 /* custom_location_indicator_navigation.obj */, + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); - path = assets; + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C865243E20B8138000392D48 /* NavigationCustom */ = { + 83C837B72C207F340004F54E /* NavigationCustom */ = { isa = PBXNativeTarget; - buildConfigurationList = C865245120B8138200392D48 /* Build configuration list for PBXNativeTarget "NavigationCustom" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "NavigationCustom" */; buildPhases = ( - C865243B20B8138000392D48 /* Sources */, - C865243C20B8138000392D48 /* Frameworks */, - C865243D20B8138000392D48 /* Resources */, - C8CE86F52236D58700701A47 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -129,101 +135,80 @@ ); name = NavigationCustom; productName = NavigationCustom; - productReference = C865243F20B8138000392D48 /* NavigationCustom.app */; + productReference = 83C837B82C207F340004F54E /* NavigationCustom.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 "NavigationCustom" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "NavigationCustom" */; + 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 /* NavigationCustom */, + 83C837B72C207F340004F54E /* NavigationCustom */, ); }; /* 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 */, - C8EC2E9A273343C6005175D4 /* custom_location_indicator_pedestrian.png in Resources */, - C8EC2E9B273343C6005175D4 /* custom_location_indicator_navigation.png in Resources */, - C8EC2E99273343C6005175D4 /* custom_location_indicator_pedestrian.obj in Resources */, - C8EC2E9C273343C6005175D4 /* custom_location_indicator_navigation.obj in Resources */, - C865244820B8138000392D48 /* Main.storyboard in Resources */, + 83C066C72CCB9F6F007A890F /* custom_location_indicator_navigation.png in Resources */, + 83C066C82CCB9F6F007A890F /* custom_location_indicator_navigation.obj in Resources */, + 83C066C62CCB9F6F007A890F /* custom_location_indicator_pedestrian.png in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, + 83C066C52CCB9F6F007A890F /* custom_location_indicator_pedestrian.obj 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 /* NavigationCustomApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* NavigationCustomExample.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; @@ -242,18 +227,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; @@ -268,22 +254,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.0; - MTL_ENABLE_DEBUG_INFO = YES; + 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; @@ -302,18 +290,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; @@ -322,57 +311,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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 = "\"NavigationCustom/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = NavigationCustom/Info.plist; + 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 = 15.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 = "\"NavigationCustom/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = NavigationCustom/Info.plist; + 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 = 15.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"; }; @@ -381,25 +383,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C865243A20B8138000392D48 /* Build configuration list for PBXProject "NavigationCustom" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "NavigationCustom" */ = { isa = XCConfigurationList; buildConfigurations = ( - C865244F20B8138200392D48 /* Debug */, - C865245020B8138200392D48 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C865245120B8138200392D48 /* Build configuration list for PBXNativeTarget "NavigationCustom" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "NavigationCustom" */ = { 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/NavigationCustom/NavigationCustom/AppDelegate.swift b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/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/NavigationCustom/NavigationCustom/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/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/NavigationCustom/NavigationCustom/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/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/NavigationCustom/NavigationCustom/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/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/NavigationCustom/NavigationCustom/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f83f6fd5..00000000 --- a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Base.lproj/Main.storyboard deleted file mode 100644 index c665740e..00000000 --- a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Base.lproj/Main.storyboard +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/ContentView.swift b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/ContentView.swift new file mode 100644 index 00000000..19f96289 --- /dev/null +++ b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/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 navigationCustomExample: NavigationCustomExample? + + 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: "Start") { + navigationCustomExample?.startButtonClicked() + } + CustomButton(title: "Stop") { + navigationCustomExample?.stopButtonClicked() + } + CustomButton(title: "Toggle") { + navigationCustomExample?.toggleButtonClicked() + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + navigationCustomExample = NavigationCustomExample(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/NavigationCustom/NavigationCustom/Info.plist b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/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/NavigationCustom/NavigationCustom/NavigationCustomApp.swift b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/NavigationCustomApp.swift new file mode 100644 index 00000000..ff3acc2c --- /dev/null +++ b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/NavigationCustomApp.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 NavigationCustomApp: 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/NavigationCustom/NavigationCustom/ViewController.swift b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/NavigationCustomExample.swift similarity index 90% rename from examples/latest/navigate/ios/NavigationCustom/NavigationCustom/ViewController.swift rename to examples/latest/navigate/ios/NavigationCustom/NavigationCustom/NavigationCustomExample.swift index b1aa14b0..1f852ca8 100644 --- a/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/ViewController.swift +++ b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/NavigationCustomExample.swift @@ -20,10 +20,11 @@ import heresdk import UIKit -class ViewController: UIViewController, AnimationDelegate, LocationDelegate { - - @IBOutlet var mapView: MapView! - +// This example shows how to customize the navigation experience. +class NavigationCustomExample: AnimationDelegate, LocationDelegate { + + private var mapView: MapView + private let routeStartGeoCoordinates = GeoCoordinates(latitude: 52.520798, longitude: 13.409408) private let distanceInMeters: Double = 1000 @@ -35,32 +36,33 @@ class ViewController: UIViewController, AnimationDelegate, LocationDelegate { private var lastKnownLocation: Location? private var isDefaultLocationIndicator = true private var myRoute: Route? + + init(_ mapView: MapView) { + self.mapView = mapView - override func viewDidLoad() { - super.viewDidLoad() - + // Configure the map. + let camera = mapView.camera + let distanceToEarthInMeters: Double = 1000 + camera.lookAt(point: routeStartGeoCoordinates, + zoom: MapMeasure(kind: .distance, value: distanceToEarthInMeters)) + // 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 { print("Error: Map scene not loaded, \(String(describing: mapError))") return } - // Configure the map. - let camera = mapView.camera - let distanceToEarthInMeters: Double = 1000 - camera.lookAt(point: routeStartGeoCoordinates, - zoom: MapMeasure(kind: .distance, value: distanceToEarthInMeters)) - // Optionally, enable textured 3D landmarks. mapView.mapScene.enableFeatures([MapFeatures.landmarks : MapFeatureModes.landmarksTextured]) startAppLogic() } - + private func startAppLogic() { do { try routingEngine = RoutingEngine() @@ -95,13 +97,13 @@ class ViewController: UIViewController, AnimationDelegate, LocationDelegate { private func createCustomLocationIndicator() -> LocationIndicator { // Create an "assets" directory and add the folder with content via drag & drop. // Adjust file name and path as appropriate for your project. - let pedGeometryFile = getResourceStringFromBundle(name: "custom_location_indicator_pedestrian", type: "obj") - let pedTextureFile = getResourceStringFromBundle(name: "custom_location_indicator_pedestrian", type: "png") + let pedGeometryFile = getResourceStringFromBundle(fileName: "custom_location_indicator_pedestrian", type: "obj") + let pedTextureFile = getResourceStringFromBundle(fileName: "custom_location_indicator_pedestrian", type: "png") let pedestrianMapMarker3DModel = MapMarker3DModel(geometryFilePath: pedGeometryFile, textureFilePath: pedTextureFile) - let navGeometryFile = getResourceStringFromBundle(name: "custom_location_indicator_navigation", type: "obj") - let navTextureFile = getResourceStringFromBundle(name: "custom_location_indicator_navigation", type: "png") + let navGeometryFile = getResourceStringFromBundle(fileName: "custom_location_indicator_navigation", type: "obj") + let navTextureFile = getResourceStringFromBundle(fileName: "custom_location_indicator_navigation", type: "png") let navigationMapMarker3DModel = MapMarker3DModel(geometryFilePath: navGeometryFile, textureFilePath: navTextureFile) @@ -122,19 +124,17 @@ class ViewController: UIViewController, AnimationDelegate, LocationDelegate { return locationIndicator } - private func getResourceStringFromBundle(name: String, type: String) -> String { - let bundle = Bundle(for: ViewController.self) - let resourceUrl = bundle.url(forResource: name, - withExtension: type) - guard let resourceString = resourceUrl?.path else { + private func getResourceStringFromBundle(fileName: String, type: String) -> String { + let bundle = Bundle.main + guard let resourceUrl = bundle.url(forResource: fileName, withExtension: type) else { fatalError("Error: Resource not found!") } - return resourceString + return resourceUrl.path } - + // Calculate a fixed route for testing and start guidance simulation along the route. - @IBAction func startButtonClicked(_ sender: Any) { + func startButtonClicked() { if visualNavigator!.isRendering { return; } @@ -156,14 +156,14 @@ class ViewController: UIViewController, AnimationDelegate, LocationDelegate { } // Stop guidance simulation and switch pedestrian LocationIndicator on. - @IBAction func stopButtonClicked(_ sender: Any) { + func stopButtonClicked() { stopGuidance() } // Toggle between the default LocationIndicator and custom LocationIndicator. // The default LocationIndicator uses a 3D asset that is part of the HERE SDK. // The custom LocationIndicator uses different 3D assets, see asset folder. - @IBAction func toggleButtonClicked(_ sender: Any) { + func toggleButtonClicked() { // Toggle state. isDefaultLocationIndicator = !isDefaultLocationIndicator @@ -274,7 +274,7 @@ class ViewController: UIViewController, AnimationDelegate, LocationDelegate { zoom: mapMeasure, bowFactor: 1, duration: durationInSeconds) - mapView.camera.startAnimation(animation) + mapView.camera.startAnimation(animation) } private func startGuidance(route: Route) { @@ -375,14 +375,20 @@ class ViewController: UIViewController, AnimationDelegate, LocationDelegate { lastKnownLocation = location } - 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/NavigationCustom/NavigationCustom/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/NavigationCustom/NavigationCustom/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/OfflineMaps/OfflineMaps/OfflineMapsExample.swift b/examples/latest/navigate/ios/OfflineMaps/OfflineMaps/OfflineMapsExample.swift index 8fc04001..3654c240 100644 --- a/examples/latest/navigate/ios/OfflineMaps/OfflineMaps/OfflineMapsExample.swift +++ b/examples/latest/navigate/ios/OfflineMaps/OfflineMaps/OfflineMapsExample.swift @@ -331,7 +331,7 @@ class OfflineMapsExample : DownloadRegionsStatusListener { let textQuery = TextQuery("restaurants", area: queryArea) let searchOptions = SearchOptions(languageCode: LanguageCode.enUs, maxItems: 30) - offlineSearchEngine.search(textQuery: textQuery, + offlineSearchEngine.searchByText(textQuery, options: searchOptions) { error, places in if let searchError = error { self.showMessage("Search Error: \(searchError)") diff --git a/examples/latest/navigate/ios/PublicTransit/PublicTransit.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/PublicTransit/PublicTransit.xcodeproj/project.pbxproj index 025dbe71..5e6a5960 100644 --- a/examples/latest/navigate/ios/PublicTransit/PublicTransit.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/PublicTransit/PublicTransit.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - 2A968C4B26561CFE00913121 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A968C4A26561CFE00913121 /* AppDelegate.swift */; }; - 2A968C4F26561CFE00913121 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A968C4E26561CFE00913121 /* ViewController.swift */; }; - 2A968C5226561CFE00913121 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A968C5026561CFE00913121 /* Main.storyboard */; }; - 2A968C5426561CFE00913121 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 2A968C5326561CFE00913121 /* Assets.xcassets */; }; - 2A968C5726561CFE00913121 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 2A968C5526561CFE00913121 /* LaunchScreen.storyboard */; }; - 2A968C89265620DD00913121 /* PublicTransportRoutingExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A968C88265620DD00913121 /* PublicTransportRoutingExample.swift */; }; - C8AE75702658378100B320DE /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C8AE756F2658378100B320DE /* heresdk.xcframework */; }; - C8AE75712658378100B320DE /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C8AE756F2658378100B320DE /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837BC2C207F340004F54E /* PublicTransitApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* PublicTransitApp.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 /* PublicTransitExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* PublicTransitExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C8AE75722658378100B320DE /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C8AE75712658378100B320DE /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* heresdk.xcframework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,66 +31,68 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 2A968C4726561CFD00913121 /* PublicTransit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PublicTransit.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 2A968C4A26561CFE00913121 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 2A968C4E26561CFE00913121 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - 2A968C5126561CFE00913121 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 2A968C5326561CFE00913121 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 2A968C5626561CFE00913121 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 2A968C5826561CFF00913121 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 2A968C8426561E8400913121 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; name = heresdk.xcframework; path = "../../../HERESDK/4.7.3-release/heresdk-navigate-ios-4.7.3.0.5498/heresdk/frameworks/heresdk.xcframework"; sourceTree = ""; }; - 2A968C88265620DD00913121 /* PublicTransportRoutingExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicTransportRoutingExample.swift; sourceTree = ""; }; - C8AE756F2658378100B320DE /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* PublicTransit.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PublicTransit.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* PublicTransitApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicTransitApp.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 /* PublicTransitExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PublicTransitExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 2A968C4426561CFD00913121 /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C8AE75702658378100B320DE /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* heresdk.xcframework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 2A968C3E26561CFD00913121 = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - 2A968C4926561CFD00913121 /* PublicTransit */, - 2A968C4826561CFD00913121 /* Products */, - 2A968C8326561E8400913121 /* Frameworks */, + 83C837BA2C207F340004F54E /* PublicTransit */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - 2A968C4826561CFD00913121 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - 2A968C4726561CFD00913121 /* PublicTransit.app */, + 83C837B82C207F340004F54E /* PublicTransit.app */, ); name = Products; sourceTree = ""; }; - 2A968C4926561CFD00913121 /* PublicTransit */ = { + 83C837BA2C207F340004F54E /* PublicTransit */ = { isa = PBXGroup; children = ( - 2A968C4A26561CFE00913121 /* AppDelegate.swift */, - 2A968C5326561CFE00913121 /* Assets.xcassets */, - 2A968C5826561CFF00913121 /* Info.plist */, - 2A968C5526561CFE00913121 /* LaunchScreen.storyboard */, - 2A968C5026561CFE00913121 /* Main.storyboard */, - 2A968C88265620DD00913121 /* PublicTransportRoutingExample.swift */, - 2A968C4E26561CFE00913121 /* ViewController.swift */, + 83C837BB2C207F340004F54E /* PublicTransitApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* PublicTransitExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = PublicTransit; sourceTree = ""; }; - 2A968C8326561E8400913121 /* Frameworks */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C8AE756F2658378100B320DE /* heresdk.xcframework */, - 2A968C8426561E8400913121 /* heresdk.xcframework */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, + ); + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C837CA2C20AAE50004F54E /* heresdk.xcframework */, ); name = Frameworks; sourceTree = ""; @@ -99,14 +100,14 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 2A968C4626561CFD00913121 /* PublicTransit */ = { + 83C837B72C207F340004F54E /* PublicTransit */ = { isa = PBXNativeTarget; - buildConfigurationList = 2A968C7126561CFF00913121 /* Build configuration list for PBXNativeTarget "PublicTransit" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "PublicTransit" */; buildPhases = ( - 2A968C4326561CFD00913121 /* Sources */, - 2A968C4426561CFD00913121 /* Frameworks */, - 2A968C4526561CFD00913121 /* Resources */, - C8AE75722658378100B320DE /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -114,95 +115,76 @@ ); name = PublicTransit; productName = PublicTransit; - productReference = 2A968C4726561CFD00913121 /* PublicTransit.app */; + productReference = 83C837B82C207F340004F54E /* PublicTransit.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - 2A968C3F26561CFD00913121 /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1240; - LastUpgradeCheck = 1250; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - 2A968C4626561CFD00913121 = { - CreatedOnToolsVersion = 12.4; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = 2A968C4226561CFD00913121 /* Build configuration list for PBXProject "PublicTransit" */; - compatibilityVersion = "Xcode 9.3"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "PublicTransit" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = 2A968C3E26561CFD00913121; - productRefGroup = 2A968C4826561CFD00913121 /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - 2A968C4626561CFD00913121 /* PublicTransit */, + 83C837B72C207F340004F54E /* PublicTransit */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 2A968C4526561CFD00913121 /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2A968C5726561CFE00913121 /* LaunchScreen.storyboard in Resources */, - 2A968C5426561CFE00913121 /* Assets.xcassets in Resources */, - 2A968C5226561CFE00913121 /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 2A968C4326561CFD00913121 /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 2A968C4F26561CFE00913121 /* ViewController.swift in Sources */, - 2A968C89265620DD00913121 /* PublicTransportRoutingExample.swift in Sources */, - 2A968C4B26561CFE00913121 /* AppDelegate.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* PublicTransitApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* PublicTransitExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - 2A968C5026561CFE00913121 /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 2A968C5126561CFE00913121 /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 2A968C5526561CFE00913121 /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 2A968C5626561CFE00913121 /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - 2A968C6F26561CFF00913121 /* 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; @@ -248,23 +230,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - 2A968C7026561CFF00913121 /* 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; @@ -304,58 +287,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - 2A968C7226561CFF00913121 /* 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 = "\"PublicTransit/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = PublicTransit/Info.plist; + 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 = 15.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; }; - 2A968C7326561CFF00913121 /* 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 = "\"PublicTransit/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = PublicTransit/Info.plist; + 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 = 15.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 */ - 2A968C4226561CFD00913121 /* Build configuration list for PBXProject "PublicTransit" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "PublicTransit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 2A968C6F26561CFF00913121 /* Debug */, - 2A968C7026561CFF00913121 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 2A968C7126561CFF00913121 /* Build configuration list for PBXNativeTarget "PublicTransit" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "PublicTransit" */ = { isa = XCConfigurationList; buildConfigurations = ( - 2A968C7226561CFF00913121 /* Debug */, - 2A968C7326561CFF00913121 /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = 2A968C3F26561CFD00913121 /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/navigate/ios/PublicTransit/PublicTransit/AppDelegate.swift b/examples/latest/navigate/ios/PublicTransit/PublicTransit/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/PublicTransit/PublicTransit/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/PublicTransit/PublicTransit/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/PublicTransit/PublicTransit/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/PublicTransit/PublicTransit/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/PublicTransit/PublicTransit/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/PublicTransit/PublicTransit/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/PublicTransit/PublicTransit/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/PublicTransit/PublicTransit/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/PublicTransit/PublicTransit/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/PublicTransit/PublicTransit/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/PublicTransit/PublicTransit/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/PublicTransit/PublicTransit/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/PublicTransit/PublicTransit/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/PublicTransit/PublicTransit/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/navigate/ios/PublicTransit/PublicTransit/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/PublicTransit/PublicTransit/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/PublicTransit/PublicTransit/Base.lproj/Main.storyboard deleted file mode 100644 index 47ec41a8..00000000 --- a/examples/latest/navigate/ios/PublicTransit/PublicTransit/Base.lproj/Main.storyboard +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/PublicTransit/PublicTransit/ContentView.swift b/examples/latest/navigate/ios/PublicTransit/PublicTransit/ContentView.swift new file mode 100644 index 00000000..0700824d --- /dev/null +++ b/examples/latest/navigate/ios/PublicTransit/PublicTransit/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 publicTransitExample: PublicTransitExample? + + 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: "Add transit route") { + publicTransitExample?.addTransitRoute() + } + CustomButton(title: "Clear map") { + publicTransitExample?.clearMap() + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + publicTransitExample = PublicTransitExample(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/PublicTransit/PublicTransit/Info.plist b/examples/latest/navigate/ios/PublicTransit/PublicTransit/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/PublicTransit/PublicTransit/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/PublicTransit/PublicTransit/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/PublicTransit/PublicTransit/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/PublicTransit/PublicTransit/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/PublicTransit/PublicTransit/PublicTransitApp.swift b/examples/latest/navigate/ios/PublicTransit/PublicTransit/PublicTransitApp.swift new file mode 100644 index 00000000..98c6d989 --- /dev/null +++ b/examples/latest/navigate/ios/PublicTransit/PublicTransit/PublicTransitApp.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 PublicTransitApp: 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/PublicTransit/PublicTransit/PublicTransportRoutingExample.swift b/examples/latest/navigate/ios/PublicTransit/PublicTransit/PublicTransitExample.swift similarity index 88% rename from examples/latest/explore/ios/PublicTransit/PublicTransit/PublicTransportRoutingExample.swift rename to examples/latest/navigate/ios/PublicTransit/PublicTransit/PublicTransitExample.swift index de4277ec..c8ce7173 100644 --- a/examples/latest/explore/ios/PublicTransit/PublicTransit/PublicTransportRoutingExample.swift +++ b/examples/latest/navigate/ios/PublicTransit/PublicTransit/PublicTransitExample.swift @@ -20,9 +20,8 @@ import heresdk import UIKit -class PublicTranportRoutingExample { +class PublicTransitExample { - private var viewController: UIViewController private var mapView: MapView private var mapMarkers = [MapMarker]() private var mapPolylineList = [MapPolyline]() @@ -30,9 +29,10 @@ class PublicTranportRoutingExample { private var startGeoCoordinates: GeoCoordinates? private var destinationGeoCoordinates: GeoCoordinates? - 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), @@ -43,8 +43,18 @@ class PublicTranportRoutingExample { } catch let engineInstantiationError { fatalError("Failed to initialize routing engine. 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?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } + } + func addTransitRoute() { startGeoCoordinates = createRandomGeoCoordinatesAroundMapCenter() destinationGeoCoordinates = createRandomGeoCoordinatesAroundMapCenter() @@ -132,7 +142,7 @@ class PublicTranportRoutingExample { let destination = route.sections.last!.arrivalPlace.mapMatchedCoordinates // Draw a circle to indicate starting point and destination. - addCircleMapMarker(geoCoordinates: startPoint, imageName: "green_dot.png") + addCircleMapMarker(geoCoordinates: startPoint, imageName: "red_dot.png") addCircleMapMarker(geoCoordinates: destination, imageName: "green_dot.png") // Log maneuver instructions per route leg / sections. @@ -208,8 +218,19 @@ class PublicTranportRoutingExample { } 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/PublicTransit/PublicTransit/ViewController.swift b/examples/latest/navigate/ios/PublicTransit/PublicTransit/ViewController.swift deleted file mode 100644 index 4ecd5213..00000000 --- a/examples/latest/navigate/ios/PublicTransit/PublicTransit/ViewController.swift +++ /dev/null @@ -1,61 +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 publicTransportRoutingExample: PublicTranportRoutingExample! - 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 - } - - // Start the example. - self.publicTransportRoutingExample = PublicTranportRoutingExample(viewController: self, mapView: self.mapView!) - self.isMapSceneLoaded = true - } - - @IBAction func onAddTransitRouteButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - publicTransportRoutingExample.addTransitRoute() - } - } - - @IBAction func onClearMapButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - publicTransportRoutingExample.clearMap() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/PublicTransit/README.md b/examples/latest/navigate/ios/PublicTransit/README.md index f26f04b5..966d2d2d 100644 --- a/examples/latest/navigate/ios/PublicTransit/README.md +++ b/examples/latest/navigate/ios/PublicTransit/README.md @@ -1,4 +1,4 @@ -The Public Transit example app shows how to calculate a public transport route from A to B that is visualized on the map. You can find how this is done in [PublicTransportRoutingExample.swift](PublicTransit/PublicTransportRoutingExample.swift). +The Public Transit example app shows how to calculate a public transport route from A to B that is visualized on the map. You can find how this is done in [PublicTransitExample.swift](PublicTransit/PublicTransitExample.swift). Build instructions: ------------------- diff --git a/examples/latest/navigate/ios/Routing/Routing.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/Routing/Routing.xcodeproj/project.pbxproj index bcb54376..de06b26e 100644 --- a/examples/latest/navigate/ios/Routing/Routing.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/Routing/Routing.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 56; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ diff --git a/examples/latest/navigate/ios/RoutingHybrid/README.md b/examples/latest/navigate/ios/RoutingHybrid/README.md index e7064f02..ed656a99 100644 --- a/examples/latest/navigate/ios/RoutingHybrid/README.md +++ b/examples/latest/navigate/ios/RoutingHybrid/README.md @@ -1,4 +1,4 @@ -The Routing example app shows how to calculate a route from A to B with a number of waypoints in between that is visualized on the map. It also shows how to calculate routes in offline mode, when there is no connectivity available. You can find how this is done in [RoutingExample.swift](RoutingHybrid/RoutingExample.swift). +The RoutingHybrid example app shows how to calculate a route from A to B with a number of waypoints in between that is visualized on the map. It also shows how to calculate routes in offline mode, when there is no connectivity available. You can find how this is done in [RoutingHybridExample.swift](RoutingHybrid/RoutingHybridExample.swift). Build instructions: ------------------- diff --git a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid.xcodeproj/project.pbxproj index b5d8b209..abe48c4b 100644 --- a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid.xcodeproj/project.pbxproj @@ -3,28 +3,27 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; 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, ); }; }; + 830C4ABD2CC6520900B4252B /* RoutingHybridExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 830C4ABC2CC6520900B4252B /* RoutingHybridExample.swift */; }; + 83C837BC2C207F340004F54E /* RoutingHybridApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* RoutingHybridApp.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, ); }; }; /* 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 /* RoutingHybrid.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RoutingHybrid.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 = ""; }; + 830C4ABC2CC6520900B4252B /* RoutingHybridExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RoutingHybridExample.swift; sourceTree = ""; }; + 83C837B82C207F340004F54E /* RoutingHybrid.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RoutingHybrid.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* RoutingHybridApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RoutingHybridApp.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 = ""; }; /* 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 /* RoutingHybrid */, - C85F808F21E5EDD800237ED0 /* Products */, - C88C015623CDF9FC00043918 /* Frameworks */, + 83C837BA2C207F340004F54E /* RoutingHybrid */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); sourceTree = ""; }; - C85F808F21E5EDD800237ED0 /* Products */ = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C85F808E21E5EDD800237ED0 /* RoutingHybrid.app */, + 83C837B82C207F340004F54E /* RoutingHybrid.app */, ); name = Products; sourceTree = ""; }; - C85F809021E5EDD800237ED0 /* RoutingHybrid */ = { + 83C837BA2C207F340004F54E /* RoutingHybrid */ = { 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 /* RoutingHybridApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 830C4ABC2CC6520900B4252B /* RoutingHybridExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); path = RoutingHybrid; 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 /* RoutingHybrid */ = { + 83C837B72C207F340004F54E /* RoutingHybrid */ = { isa = PBXNativeTarget; - buildConfigurationList = C85F80A021E5EDD900237ED0 /* Build configuration list for PBXNativeTarget "RoutingHybrid" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "RoutingHybrid" */; 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 = RoutingHybrid; productName = RoutingHybrid; - productReference = C85F808E21E5EDD800237ED0 /* RoutingHybrid.app */; + productReference = 83C837B82C207F340004F54E /* RoutingHybrid.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 "RoutingHybrid" */; - compatibilityVersion = "Xcode 3.2"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "RoutingHybrid" */; + 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 /* RoutingHybrid */, + 83C837B72C207F340004F54E /* RoutingHybrid */, ); }; /* 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 /* RoutingHybridApp.swift in Sources */, + 830C4ABD2CC6520900B4252B /* RoutingHybridExample.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; @@ -249,23 +230,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; @@ -305,58 +287,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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 = "\"RoutingHybrid/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = RoutingHybrid/Info.plist; + 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 = 15.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 = "\"RoutingHybrid/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = RoutingHybrid/Info.plist; + 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 = 15.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 "RoutingHybrid" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "RoutingHybrid" */ = { isa = XCConfigurationList; buildConfigurations = ( - C85F809E21E5EDD900237ED0 /* Debug */, - C85F809F21E5EDD900237ED0 /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C85F80A021E5EDD900237ED0 /* Build configuration list for PBXNativeTarget "RoutingHybrid" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "RoutingHybrid" */ = { 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/RoutingHybrid/RoutingHybrid/AppDelegate.swift b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/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/RoutingHybrid/RoutingHybrid/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/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/RoutingHybrid/RoutingHybrid/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/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/RoutingHybrid/RoutingHybrid/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/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/RoutingHybrid/RoutingHybrid/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index ef003010..00000000 --- a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Base.lproj/Main.storyboard deleted file mode 100644 index 55cebdb7..00000000 --- a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Base.lproj/Main.storyboard +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/ContentView.swift b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/ContentView.swift new file mode 100644 index 00000000..f8bc3e4b --- /dev/null +++ b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/ContentView.swift @@ -0,0 +1,93 @@ +/* + * 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 routingHybridExample: RoutingHybridExample? + + 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") { + routingHybridExample?.addRoute() + } + CustomButton(title: "Add waypoints") { + routingHybridExample?.addWaypoints() + } + CustomButton(title: "Clear") { + routingHybridExample?.clearMap() + } + } + HStack { + CustomButton(title: "Switch online") { + routingHybridExample?.onSwitchOnlineButtonClicked() + } + CustomButton(title: "Switch offline") { + routingHybridExample?.onSwitchOfflineButtonClicked() + } + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + routingHybridExample = RoutingHybridExample(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/RoutingHybrid/RoutingHybrid/Info.plist b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/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/RoutingHybrid/RoutingHybrid/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/AppDelegate.swift b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/RoutingHybridApp.swift similarity index 63% rename from examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/AppDelegate.swift rename to examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/RoutingHybridApp.swift index 5c8c8eef..8630062c 100644 --- a/examples/latest/explore/ios/CameraKeyframeTracks/CameraKeyframeTracks/AppDelegate.swift +++ b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/RoutingHybridApp.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 { +// 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 RoutingHybridApp: App { - var window: UIWindow? + var body: some Scene { + WindowGroup { + ContentView() + } + } - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - // Override point for customization after application launch. + 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() { @@ -49,11 +63,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { 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() + // 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/RoutingHybrid/RoutingHybrid/RoutingExample.swift b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/RoutingHybridExample.swift similarity index 91% rename from examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/RoutingExample.swift rename to examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/RoutingHybridExample.swift index aa4d9877..f3c6092e 100644 --- a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/RoutingExample.swift +++ b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/RoutingHybridExample.swift @@ -21,9 +21,8 @@ import heresdk import Network import UIKit -class RoutingExample { +class RoutingHybridExample { - private var viewController: UIViewController private var mapView: MapView private var mapMarkers = [MapMarker]() private var mapPolylineList = [MapPolyline]() @@ -35,10 +34,11 @@ class RoutingExample { private var startGeoCoordinates: GeoCoordinates? private var destinationGeoCoordinates: GeoCoordinates? - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + init(_ mapView: MapView) { self.mapView = mapView let camera = mapView.camera + + // Configure the map. let distanceInMeters = MapMeasure(kind: .distance, value: 5000) camera.lookAt(point: GeoCoordinates(latitude: 52.520798, longitude: 13.409408), zoom: distanceInMeters) @@ -55,7 +55,7 @@ class RoutingExample { // This app uses only cached map data that gets downloaded when the user // pans the map. Please note that the OfflineRoutingEngine may not be able // to calculate a route, when not all map tiles are loaded. Especially, the - // vector tiles for lower zoom levels are required to find possible paths. + // vector tiles for lower zoom levels are required to find possible paths. try offlineRoutingEngine = OfflineRoutingEngine() } catch let engineInstantiationError { fatalError("Failed to initialize offline routing engine. Cause: \(engineInstantiationError)") @@ -64,6 +64,19 @@ class RoutingExample { // By default, use online routing engine. routingEngine = onlineRoutingEngine + // 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 { + print("Error: Map scene not loaded, \(String(describing: mapError))") + return + } + + mapView.mapScene.enableFeatures([MapFeatures.trafficFlow : MapFeatureModes.defaultMode]); + mapView.mapScene.enableFeatures([MapFeatures.trafficIncidents : MapFeatureModes.defaultMode]); } // Calculates a route with two waypoints (start / destination). @@ -128,7 +141,7 @@ class RoutingExample { private func showRouteOnMap(route: Route) { clearMap() - + // Show route as polyline. let routeGeoPolyline = route.geometry let polylineColor = UIColor(red: 0.051, green: 0.380, blue: 0.871, alpha: 1) @@ -137,7 +150,7 @@ class RoutingExample { // Below, we're creating an instance of MapMeasureDependentRenderSize. This instance will use the scaled width values to render the route polyline. // The parameters for the constructor are: the kind of MapMeasure (in this case, ZOOM_LEVEL), the unit of measurement for the render size (PIXELS), and the scaled width values. let mapMeasureDependentLineWidth = try MapMeasureDependentRenderSize(measureKind: MapMeasure.Kind.zoomLevel, sizeUnit: RenderSize.Unit.pixels, sizes: getDefaultLineWidthValues()) - + // We can also use MapMeasureDependentRenderSize to specify the outline width of the polyline. let outlineWidthInPixel = 1.23 * mapView.pixelScale let mapMeasureDependentOutlineWidth = try MapMeasureDependentRenderSize(sizeUnit: RenderSize.Unit.pixels, size: outlineWidthInPixel) @@ -148,27 +161,27 @@ class RoutingExample { outlineWidth: mapMeasureDependentOutlineWidth, outlineColor: outlineColor, capShape: LineCap.round)) - + mapView.mapScene.addMapPolyline(routeMapPolyline) mapPolylineList.append(routeMapPolyline) } catch let error { fatalError("Failed to render MapPolyline. Cause: \(error)") } - + let startPoint = route.sections.first!.departurePlace.mapMatchedCoordinates let destination = route.sections.last!.arrivalPlace.mapMatchedCoordinates - + // Draw a circle to indicate starting point and destination. addCircleMapMarker(geoCoordinates: startPoint, imageName: "green_dot.png") addCircleMapMarker(geoCoordinates: destination, imageName: "green_dot.png") - + // Log maneuver instructions per route leg / sections. let sections = route.sections for section in sections { logManeuverInstructions(section: section) } } - + // We are retrieving the default route line widths from VisualNavigator and scale them according to the screen's pixel density. // Note that the VisualNavigator stores the width values per zoom level MapMeasure.Kind. private func getDefaultLineWidthValues() -> [Double:Double] { @@ -250,12 +263,12 @@ class RoutingExample { } mapPolylineList.removeAll() } - + func onSwitchOnlineButtonClicked() { isDeviceConnected = true showDialog(title: "Note", message: "The app uses now the RoutingEngine.") } - + func onSwitchOfflineButtonClicked() { isDeviceConnected = false showDialog(title: "Note", message: "The app uses now the OfflineRoutingEngine.") @@ -305,8 +318,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/RoutingHybrid/RoutingHybrid/ViewController.swift b/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/ViewController.swift deleted file mode 100644 index 30660a91..00000000 --- a/examples/latest/navigate/ios/RoutingHybrid/RoutingHybrid/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! - 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.trafficFlow : MapFeatureModes.defaultMode]); - mapView.mapScene.enableFeatures([MapFeatures.trafficIncidents : MapFeatureModes.defaultMode]); - - // 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 onSwitchOnlineClicked(_ sender: Any) { - if isMapSceneLoaded { - routingExample.onSwitchOnlineButtonClicked() - } - } - - @IBAction func onSwitchOfflineClicked(_ sender: Any) { - if isMapSceneLoaded { - routingExample.onSwitchOfflineButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/Search/Search/SearchExample.swift b/examples/latest/navigate/ios/Search/Search/SearchExample.swift index 4731b792..859cdf8a 100644 --- a/examples/latest/navigate/ios/Search/Search/SearchExample.swift +++ b/examples/latest/navigate/ios/Search/Search/SearchExample.swift @@ -83,7 +83,7 @@ class SearchExample: TapDelegate, let textQuery = TextQuery(queryString, area: queryArea) let searchOptions = SearchOptions(languageCode: LanguageCode.enUs, maxItems: 30) - _ = searchEngine.search(textQuery: textQuery, + _ = searchEngine.searchByText(textQuery, options: searchOptions, completion: onSearchCompleted) } @@ -129,15 +129,15 @@ class SearchExample: TapDelegate, let queryArea = TextQuery.Area(areaCenter: centerGeoCoordinates) // Simulate a user typing a search term. - _ = searchEngine.suggest(textQuery: TextQuery("p", area: queryArea), + _ = searchEngine.suggestByText(TextQuery("p", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) - _ = searchEngine.suggest(textQuery: TextQuery("pi", area: queryArea), + _ = searchEngine.suggestByText(TextQuery("pi", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) - _ = searchEngine.suggest(textQuery: TextQuery("piz", area: queryArea), + _ = searchEngine.suggestByText(TextQuery("piz", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) } @@ -177,7 +177,7 @@ class SearchExample: TapDelegate, let query = AddressQuery(queryString, near: geoCoordinates) let geocodingOptions = SearchOptions(languageCode: LanguageCode.deDe, maxItems: 25) - _ = searchEngine.search(addressQuery: query, + _ = searchEngine.searchByAddress(query, options: geocodingOptions, completion: onGeocodingCompleted) } @@ -263,7 +263,7 @@ class SearchExample: TapDelegate, // By default results are localized in EN_US. let reverseGeocodingOptions = SearchOptions(languageCode: LanguageCode.enGb, maxItems: 1) - _ = searchEngine.search(coordinates: geoCoordinates, + _ = searchEngine.searchByCoordinates(geoCoordinates, options: reverseGeocodingOptions, completion: onReverseGeocodingCompleted) } diff --git a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridExample.swift b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridExample.swift index 0b8b235e..ea0d9995 100644 --- a/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridExample.swift +++ b/examples/latest/navigate/ios/SearchHybrid/SearchHybrid/SearchHybridExample.swift @@ -107,11 +107,11 @@ class SearchHybridExample: TapDelegate, maxItems: 30) if isDeviceConnected { - _ = searchEngine.search(textQuery: textQuery, + _ = searchEngine.searchByText(textQuery, options: searchOptions, completion: onSearchCompleted) } else { - _ = offlineSearchEngine.search(textQuery: textQuery, + _ = offlineSearchEngine.searchByText(textQuery, options: searchOptions, completion: onSearchCompleted) } @@ -166,28 +166,28 @@ class SearchHybridExample: TapDelegate, if isDeviceConnected { // Simulate a user typing a search term. - _ = searchEngine.suggest(textQuery: TextQuery("p", area: queryArea), + _ = searchEngine.suggestByText(TextQuery("p", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) - _ = searchEngine.suggest(textQuery: TextQuery("pi", area: queryArea), + _ = searchEngine.suggestByText(TextQuery("pi", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) - _ = searchEngine.suggest(textQuery: TextQuery("piz", area: queryArea), + _ = searchEngine.suggestByText(TextQuery("piz", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) } else { // Simulate a user typing a search term. - _ = offlineSearchEngine.suggest(textQuery: TextQuery("p", area: queryArea), + _ = offlineSearchEngine.suggestByText(TextQuery("p", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) - _ = offlineSearchEngine.suggest(textQuery: TextQuery("pi", area: queryArea), + _ = offlineSearchEngine.suggestByText(TextQuery("pi", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) - _ = offlineSearchEngine.suggest(textQuery: TextQuery("piz", area: queryArea), + _ = offlineSearchEngine.suggestByText(TextQuery("piz", area: queryArea), options: autosuggestOptions, completion: onSearchCompleted) } @@ -230,11 +230,11 @@ class SearchHybridExample: TapDelegate, maxItems: 25) if isDeviceConnected { - _ = searchEngine.search(addressQuery: query, + _ = searchEngine.searchByAddress(query, options: geocodingOptions, completion: onGeocodingCompleted) } else { - _ = offlineSearchEngine.search(addressQuery: query, + _ = offlineSearchEngine.searchByAddress(query, options: geocodingOptions, completion: onGeocodingCompleted) } @@ -322,11 +322,11 @@ class SearchHybridExample: TapDelegate, let reverseGeocodingOptions = SearchOptions(languageCode: LanguageCode.enGb, maxItems: 1) if isDeviceConnected { - _ = searchEngine.search(coordinates: geoCoordinates, + _ = searchEngine.searchByCoordinates(geoCoordinates, options: reverseGeocodingOptions, completion: onReverseGeocodingCompleted) } else { - _ = offlineSearchEngine.search(coordinates: geoCoordinates, + _ = offlineSearchEngine.searchByCoordinates(geoCoordinates, options: reverseGeocodingOptions, completion: onReverseGeocodingCompleted) } diff --git a/examples/latest/navigate/ios/Traffic/README.md b/examples/latest/navigate/ios/Traffic/README.md index 42d2122c..a1c970be 100644 --- a/examples/latest/navigate/ios/Traffic/README.md +++ b/examples/latest/navigate/ios/Traffic/README.md @@ -11,4 +11,4 @@ Note: If your framework version is different than the version shown in the _Deve Note: In Xcode, open the _General_ settings of the _App target_ and make sure that the HERE SDK framework appears under _Embedded Binaries_. If it does not appear, add the `heresdk.framework` to the _Embedded Binaries_ section ("Add other..." -> "Create folder references"). -Please do not forget: To run the app, you need to add your HERE SDK credentials to the `Info.plist` file of your project. More information can be found in the _Get Started_ section of the _Developer Guide_. +Please do not forget: To run the app, you need to add your HERE SDK credentials to the `AppDelegate.swift` file of your project. More information can be found in the _Get Started_ section of the _Developer Guide_. diff --git a/examples/latest/navigate/ios/Traffic/Traffic.xcodeproj/project.pbxproj b/examples/latest/navigate/ios/Traffic/Traffic.xcodeproj/project.pbxproj index bbc1ba30..b052d418 100644 --- a/examples/latest/navigate/ios/Traffic/Traffic.xcodeproj/project.pbxproj +++ b/examples/latest/navigate/ios/Traffic/Traffic.xcodeproj/project.pbxproj @@ -3,28 +3,30 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; objects = { /* Begin PBXBuildFile section */ - C88C018623CDFD3A00043918 /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018523CDFD3A00043918 /* heresdk.xcframework */; }; - C88C018723CDFD3A00043918 /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = C88C018523CDFD3A00043918 /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - C8D0BB6F2167DB0E002FD93D /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BB6E2167DB0E002FD93D /* AppDelegate.swift */; }; - C8D0BB712167DB0E002FD93D /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BB702167DB0E002FD93D /* ViewController.swift */; }; - C8D0BB742167DB0E002FD93D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BB722167DB0E002FD93D /* Main.storyboard */; }; - C8D0BB762167DB0F002FD93D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BB752167DB0F002FD93D /* Assets.xcassets */; }; - C8D0BB792167DB0F002FD93D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C8D0BB772167DB0F002FD93D /* LaunchScreen.storyboard */; }; - C8D0BB812167DC0A002FD93D /* TrafficExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = C8D0BB802167DC0A002FD93D /* TrafficExample.swift */; }; + 83C066CA2CCC057A007A890F /* heresdk.xcframework in Frameworks */ = {isa = PBXBuildFile; fileRef = 83C066C92CCC057A007A890F /* heresdk.xcframework */; }; + 83C066CB2CCC057A007A890F /* heresdk.xcframework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 83C066C92CCC057A007A890F /* heresdk.xcframework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837BC2C207F340004F54E /* TrafficApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837BB2C207F340004F54E /* TrafficApp.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 /* (null) in Frameworks */ = {isa = PBXBuildFile; }; + 83C837CC2C20AAE50004F54E /* (null) in Embed Frameworks */ = {isa = PBXBuildFile; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 83C837D12C20EFA70004F54E /* TrafficExample.swift in Sources */ = {isa = PBXBuildFile; fileRef = 83C837D02C20EFA70004F54E /* TrafficExample.swift */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ - C8288835224BD428004903B8 /* Embed Frameworks */ = { + 83C837CD2C20AAE50004F54E /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - C88C018723CDFD3A00043918 /* heresdk.xcframework in Embed Frameworks */, + 83C066CB2CCC057A007A890F /* heresdk.xcframework in Embed Frameworks */, + 83C837CC2C20AAE50004F54E /* (null) in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -32,79 +34,84 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - C88C018523CDFD3A00043918 /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; - C8D0BB6B2167DB0E002FD93D /* Traffic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Traffic.app; sourceTree = BUILT_PRODUCTS_DIR; }; - C8D0BB6E2167DB0E002FD93D /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - C8D0BB702167DB0E002FD93D /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; - C8D0BB732167DB0E002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - C8D0BB752167DB0F002FD93D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - C8D0BB782167DB0F002FD93D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - C8D0BB7A2167DB0F002FD93D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - C8D0BB802167DC0A002FD93D /* TrafficExample.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TrafficExample.swift; sourceTree = ""; }; + 83C066C92CCC057A007A890F /* heresdk.xcframework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcframework; path = heresdk.xcframework; sourceTree = ""; }; + 83C837B82C207F340004F54E /* Traffic.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Traffic.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 83C837BB2C207F340004F54E /* TrafficApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrafficApp.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 = ""; }; + 83C837D02C20EFA70004F54E /* TrafficExample.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TrafficExample.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - C8D0BB682167DB0E002FD93D /* Frameworks */ = { + 83C837B52C207F340004F54E /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - C88C018623CDFD3A00043918 /* heresdk.xcframework in Frameworks */, + 83C066CA2CCC057A007A890F /* heresdk.xcframework in Frameworks */, + 83C837CB2C20AAE50004F54E /* (null) in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - C88C018423CDFD3A00043918 /* Frameworks */ = { + 83C837AF2C207F340004F54E = { isa = PBXGroup; children = ( - C88C018523CDFD3A00043918 /* heresdk.xcframework */, + 83C837BA2C207F340004F54E /* Traffic */, + 83C837B92C207F340004F54E /* Products */, + 83C837C92C20AAE50004F54E /* Frameworks */, ); - name = Frameworks; sourceTree = ""; }; - C8D0BB622167DB0E002FD93D = { + 83C837B92C207F340004F54E /* Products */ = { isa = PBXGroup; children = ( - C8D0BB6D2167DB0E002FD93D /* Traffic */, - C8D0BB6C2167DB0E002FD93D /* Products */, - C88C018423CDFD3A00043918 /* Frameworks */, + 83C837B82C207F340004F54E /* Traffic.app */, ); + name = Products; sourceTree = ""; }; - C8D0BB6C2167DB0E002FD93D /* Products */ = { + 83C837BA2C207F340004F54E /* Traffic */ = { isa = PBXGroup; children = ( - C8D0BB6B2167DB0E002FD93D /* Traffic.app */, + 83C837BB2C207F340004F54E /* TrafficApp.swift */, + 83C837BD2C207F340004F54E /* ContentView.swift */, + 83C837D02C20EFA70004F54E /* TrafficExample.swift */, + 83C837BF2C207F360004F54E /* Assets.xcassets */, + 83C837C12C207F360004F54E /* Preview Content */, ); - name = Products; + path = Traffic; sourceTree = ""; }; - C8D0BB6D2167DB0E002FD93D /* Traffic */ = { + 83C837C12C207F360004F54E /* Preview Content */ = { isa = PBXGroup; children = ( - C8D0BB6E2167DB0E002FD93D /* AppDelegate.swift */, - C8D0BB702167DB0E002FD93D /* ViewController.swift */, - C8D0BB802167DC0A002FD93D /* TrafficExample.swift */, - C8D0BB722167DB0E002FD93D /* Main.storyboard */, - C8D0BB752167DB0F002FD93D /* Assets.xcassets */, - C8D0BB772167DB0F002FD93D /* LaunchScreen.storyboard */, - C8D0BB7A2167DB0F002FD93D /* Info.plist */, + 83C837C22C207F360004F54E /* Preview Assets.xcassets */, ); - path = Traffic; + path = "Preview Content"; + sourceTree = ""; + }; + 83C837C92C20AAE50004F54E /* Frameworks */ = { + isa = PBXGroup; + children = ( + 83C066C92CCC057A007A890F /* heresdk.xcframework */, + ); + name = Frameworks; sourceTree = ""; }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - C8D0BB6A2167DB0E002FD93D /* Traffic */ = { + 83C837B72C207F340004F54E /* Traffic */ = { isa = PBXNativeTarget; - buildConfigurationList = C8D0BB7D2167DB0F002FD93D /* Build configuration list for PBXNativeTarget "Traffic" */; + buildConfigurationList = 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Traffic" */; buildPhases = ( - C8D0BB672167DB0E002FD93D /* Sources */, - C8D0BB682167DB0E002FD93D /* Frameworks */, - C8D0BB692167DB0E002FD93D /* Resources */, - C8288835224BD428004903B8 /* Embed Frameworks */, + 83C837B42C207F340004F54E /* Sources */, + 83C837B52C207F340004F54E /* Frameworks */, + 83C837B62C207F340004F54E /* Resources */, + 83C837CD2C20AAE50004F54E /* Embed Frameworks */, ); buildRules = ( ); @@ -112,98 +119,76 @@ ); name = Traffic; productName = Traffic; - productReference = C8D0BB6B2167DB0E002FD93D /* Traffic.app */; + productReference = 83C837B82C207F340004F54E /* Traffic.app */; productType = "com.apple.product-type.application"; }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ - C8D0BB632167DB0E002FD93D /* Project object */ = { + 83C837B02C207F340004F54E /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1000; - LastUpgradeCheck = 1000; - ORGANIZATIONNAME = HERE; + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1500; + LastUpgradeCheck = 1500; TargetAttributes = { - C8D0BB6A2167DB0E002FD93D = { - CreatedOnToolsVersion = 10.0; - LastSwiftMigration = 1020; - ProvisioningStyle = Automatic; + 83C837B72C207F340004F54E = { + CreatedOnToolsVersion = 15.0.1; }; }; }; - buildConfigurationList = C8D0BB662167DB0E002FD93D /* Build configuration list for PBXProject "Traffic" */; - compatibilityVersion = "Xcode 8.0"; + buildConfigurationList = 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Traffic" */; + compatibilityVersion = "Xcode 14.0"; developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, Base, ); - mainGroup = C8D0BB622167DB0E002FD93D; - productRefGroup = C8D0BB6C2167DB0E002FD93D /* Products */; + mainGroup = 83C837AF2C207F340004F54E; + productRefGroup = 83C837B92C207F340004F54E /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( - C8D0BB6A2167DB0E002FD93D /* Traffic */, + 83C837B72C207F340004F54E /* Traffic */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - C8D0BB692167DB0E002FD93D /* Resources */ = { + 83C837B62C207F340004F54E /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BB792167DB0F002FD93D /* LaunchScreen.storyboard in Resources */, - C8D0BB762167DB0F002FD93D /* Assets.xcassets in Resources */, - C8D0BB742167DB0E002FD93D /* Main.storyboard in Resources */, + 83C837C32C207F360004F54E /* Preview Assets.xcassets in Resources */, + 83C837C02C207F360004F54E /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - C8D0BB672167DB0E002FD93D /* Sources */ = { + 83C837B42C207F340004F54E /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - C8D0BB712167DB0E002FD93D /* ViewController.swift in Sources */, - C8D0BB6F2167DB0E002FD93D /* AppDelegate.swift in Sources */, - C8D0BB812167DC0A002FD93D /* TrafficExample.swift in Sources */, + 83C837BE2C207F340004F54E /* ContentView.swift in Sources */, + 83C837BC2C207F340004F54E /* TrafficApp.swift in Sources */, + 83C837D12C20EFA70004F54E /* TrafficExample.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXVariantGroup section */ - C8D0BB722167DB0E002FD93D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BB732167DB0E002FD93D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - C8D0BB772167DB0F002FD93D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - C8D0BB782167DB0F002FD93D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - /* Begin XCBuildConfiguration section */ - C8D0BB7B2167DB0F002FD93D /* 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 +207,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; @@ -248,23 +234,24 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - C8D0BB7C2167DB0F002FD93D /* 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 +270,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; @@ -303,58 +291,70 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 15.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; }; - C8D0BB7E2167DB0F002FD93D /* 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 = "\"Traffic/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Traffic/Info.plist; + 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 = 15.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; }; - C8D0BB7F2167DB0F002FD93D /* 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 = "\"Traffic/Preview Content\""; DEVELOPMENT_TEAM = ""; - ENABLE_BITCODE = NO; - FRAMEWORK_SEARCH_PATHS = ( - "$(inherited)", - "$(PROJECT_DIR)", - ); - INFOPLIST_FILE = Traffic/Info.plist; + 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 = 15.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 +363,25 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - C8D0BB662167DB0E002FD93D /* Build configuration list for PBXProject "Traffic" */ = { + 83C837B32C207F340004F54E /* Build configuration list for PBXProject "Traffic" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BB7B2167DB0F002FD93D /* Debug */, - C8D0BB7C2167DB0F002FD93D /* Release */, + 83C837C42C207F360004F54E /* Debug */, + 83C837C52C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - C8D0BB7D2167DB0F002FD93D /* Build configuration list for PBXNativeTarget "Traffic" */ = { + 83C837C62C207F360004F54E /* Build configuration list for PBXNativeTarget "Traffic" */ = { isa = XCConfigurationList; buildConfigurations = ( - C8D0BB7E2167DB0F002FD93D /* Debug */, - C8D0BB7F2167DB0F002FD93D /* Release */, + 83C837C72C207F360004F54E /* Debug */, + 83C837C82C207F360004F54E /* Release */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; /* End XCConfigurationList section */ }; - rootObject = C8D0BB632167DB0E002FD93D /* Project object */; + rootObject = 83C837B02C207F340004F54E /* Project object */; } diff --git a/examples/latest/navigate/ios/Traffic/Traffic/AppDelegate.swift b/examples/latest/navigate/ios/Traffic/Traffic/AppDelegate.swift deleted file mode 100644 index 5c8c8eef..00000000 --- a/examples/latest/navigate/ios/Traffic/Traffic/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/Traffic/Traffic/Assets.xcassets/AccentColor.colorset/Contents.json b/examples/latest/navigate/ios/Traffic/Traffic/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 00000000..eb878970 --- /dev/null +++ b/examples/latest/navigate/ios/Traffic/Traffic/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/Traffic/Traffic/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/latest/navigate/ios/Traffic/Traffic/Assets.xcassets/AppIcon.appiconset/Contents.json index d8db8d65..13613e3e 100644 --- a/examples/latest/navigate/ios/Traffic/Traffic/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/examples/latest/navigate/ios/Traffic/Traffic/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/Traffic/Traffic/Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Traffic/Traffic/Assets.xcassets/Contents.json index da4a164c..73c00596 100644 --- a/examples/latest/navigate/ios/Traffic/Traffic/Assets.xcassets/Contents.json +++ b/examples/latest/navigate/ios/Traffic/Traffic/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/Traffic/Traffic/Base.lproj/LaunchScreen.storyboard b/examples/latest/navigate/ios/Traffic/Traffic/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index bfa36129..00000000 --- a/examples/latest/navigate/ios/Traffic/Traffic/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/Traffic/Traffic/Base.lproj/Main.storyboard b/examples/latest/navigate/ios/Traffic/Traffic/Base.lproj/Main.storyboard deleted file mode 100644 index ae3b324d..00000000 --- a/examples/latest/navigate/ios/Traffic/Traffic/Base.lproj/Main.storyboard +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/latest/navigate/ios/Traffic/Traffic/ContentView.swift b/examples/latest/navigate/ios/Traffic/Traffic/ContentView.swift new file mode 100644 index 00000000..34d21106 --- /dev/null +++ b/examples/latest/navigate/ios/Traffic/Traffic/ContentView.swift @@ -0,0 +1,82 @@ +/* + * 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 trafficExample: TrafficExample? + + 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: "Enable All") { + trafficExample?.enableTrafficVisualization() + } + CustomButton(title: "DisableAll") { + trafficExample?.disableTrafficVisualization() + } + } + } + } + .onAppear { + // ContentView appeared, now we init the example. + trafficExample = TrafficExample(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/Traffic/Traffic/Info.plist b/examples/latest/navigate/ios/Traffic/Traffic/Info.plist deleted file mode 100644 index 4672fe75..00000000 --- a/examples/latest/navigate/ios/Traffic/Traffic/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/Traffic/Traffic/Preview Content/Preview Assets.xcassets/Contents.json b/examples/latest/navigate/ios/Traffic/Traffic/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 00000000..73c00596 --- /dev/null +++ b/examples/latest/navigate/ios/Traffic/Traffic/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/examples/latest/navigate/ios/Traffic/Traffic/TrafficApp.swift b/examples/latest/navigate/ios/Traffic/Traffic/TrafficApp.swift new file mode 100644 index 00000000..424ba018 --- /dev/null +++ b/examples/latest/navigate/ios/Traffic/Traffic/TrafficApp.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 TrafficApp: 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/Traffic/Traffic/TrafficExample.swift b/examples/latest/navigate/ios/Traffic/Traffic/TrafficExample.swift index 574c594d..5e1f4552 100644 --- a/examples/latest/navigate/ios/Traffic/Traffic/TrafficExample.swift +++ b/examples/latest/navigate/ios/Traffic/Traffic/TrafficExample.swift @@ -20,17 +20,16 @@ import heresdk import UIKit -class TrafficExample: TapDelegate { - - private var viewController: UIViewController +class TrafficExample : TapDelegate { + private var mapView: MapView private var trafficEngine: TrafficEngine // Visualizes traffic incidents found with the TrafficEngine. private var mapPolylineList = [MapPolyline]() private var tappedGeoCoordinates: GeoCoordinates = GeoCoordinates(latitude: -1, longitude: -1) - init(viewController: UIViewController, mapView: MapView) { - self.viewController = viewController + + init(_ mapView: MapView) { self.mapView = mapView let camera = mapView.camera let distanceInMeters = MapMeasure(kind: .distance, value: 1000 * 10) @@ -42,37 +41,39 @@ class TrafficExample: TapDelegate { } catch let engineInstantiationError { fatalError("Failed to initialize TrafficEngine. Cause: \(engineInstantiationError)") } + + // Load the map scene using a map scheme to render the map with. + mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene) // Setting a tap handler to pick and search for traffic incidents around the tapped area. mapView.gestures.tapDelegate = self - + showDialog(title: "Note", message: "Tap on the map to pick a traffic incident.") } - func onEnableAllButtonClicked() { - // Show real-time traffic lines and incidents on the map. - enableTrafficVisualization() - } - - func onDisableAllButtonClicked() { - disableTrafficVisualization() + // Completion handler for loadScene(). + private func onLoadScene(mapError: MapError?) { + if let mapError = mapError { + print("Error: Map scene not loaded, \(String(describing: mapError))") + } } - private func enableTrafficVisualization() { + func enableTrafficVisualization() { // Once these layers are added to the map, they will be automatically updated while panning the map. mapView.mapScene.enableFeatures([MapFeatures.trafficFlow : MapFeatureModes.trafficFlowWithFreeFlow]) // MapFeatures.trafficIncidents renders traffic icons and lines to indicate the location of incidents. mapView.mapScene.enableFeatures([MapFeatures.trafficIncidents: MapFeatureModes.defaultMode]) } - - private func disableTrafficVisualization() { + + func disableTrafficVisualization() { mapView.mapScene.disableFeatures([MapFeatures.trafficFlow, MapFeatures.trafficIncidents]) // This clears only the custom visualization for incidents found with the TrafficEngine. clearTrafficIncidentsMapPolylines() } + // Conforming to TapDelegate protocol. func onTap(origin: Point2D) { // Can be nil when the map was tilted and the sky was tapped. @@ -86,7 +87,7 @@ class TrafficExample: TapDelegate { queryForIncidents(centerCoords: tappedGeoCoordinates) } } - + // Traffic incidents can only be picked, when MapScene.Layers.trafficIncidents is visible. func pickTrafficIncident(touchPointInPixels: Point2D) { let originInPixels = Point2D(x: touchPointInPixels.x, y: touchPointInPixels.y) @@ -103,7 +104,7 @@ class TrafficExample: TapDelegate { let filter = MapScene.MapPickFilter(filter: contentTypesToPickFrom); mapView.pick(filter:filter,inside: rectangle, completion: onPickMapContent) } - + // MapViewBase.PickMapContentHandler to receive picked map content. func onPickMapContent(mapPickResults: MapPickResult?) { guard let mapPickResults = mapPickResults else { @@ -139,7 +140,7 @@ class TrafficExample: TapDelegate { lookupOptions: trafficIncidentsLookupOptions, completion: onTrafficIncidentCompletion) } - + // TrafficIncidentCompletionHandler to receive traffic incidents from ID. func onTrafficIncidentCompletion(trafficQueryError: TrafficQueryError?, trafficIncident: TrafficIncident?) { if trafficQueryError == nil { @@ -170,7 +171,7 @@ class TrafficExample: TapDelegate { fatalError("Failed to render MapPolyline. Cause: \(error)") } } - + private func queryForIncidents(centerCoords: GeoCoordinates) { let geoCircle = GeoCircle(center: centerCoords, radiusInMeters: 1000) let trafficIncidentsQueryOptions = TrafficIncidentsQueryOptions() @@ -236,8 +237,19 @@ class TrafficExample: 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/Traffic/Traffic/ViewController.swift b/examples/latest/navigate/ios/Traffic/Traffic/ViewController.swift deleted file mode 100644 index 5edc4ef1..00000000 --- a/examples/latest/navigate/ios/Traffic/Traffic/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 trafficExample: TrafficExample! - 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. - trafficExample = TrafficExample(viewController: self, mapView: mapView!) - isMapSceneLoaded = true - } - - @IBAction func onEnableAllButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - trafficExample.onEnableAllButtonClicked() - } - } - - @IBAction func onDisableAllButtonClicked(_ sender: Any) { - if isMapSceneLoaded { - trafficExample.onDisableAllButtonClicked() - } - } - - override func didReceiveMemoryWarning() { - super.didReceiveMemoryWarning() - mapView.handleLowMemory() - } -} diff --git a/examples/latest/navigate/ios/TruckGuidance/TruckGuidance/TruckGuidanceExample.swift b/examples/latest/navigate/ios/TruckGuidance/TruckGuidance/TruckGuidanceExample.swift index a0d8a9ab..005ef77a 100644 --- a/examples/latest/navigate/ios/TruckGuidance/TruckGuidance/TruckGuidanceExample.swift +++ b/examples/latest/navigate/ios/TruckGuidance/TruckGuidance/TruckGuidanceExample.swift @@ -236,7 +236,7 @@ class TruckGuidanceExample: TapDelegate, let topmostContent = cartoPOIList[0] print("Carto POI picked: \(topmostContent.name), Place category: \(topmostContent.placeCategoryId)") // Use the search engine to retrieve more details. - self.searchEngine.searchPickedPlace(pickedPlace: topmostContent, languageCode: .enUs) { searchError, place in + self.searchEngine.searchByPickedPlace(topmostContent, languageCode: .enUs) { searchError, place in if let searchError = searchError { self.showDialog(title: "Error", message: "searchPickedPlace() resulted in an error: \(searchError.rawValue)") return @@ -262,8 +262,10 @@ class TruckGuidanceExample: TapDelegate, if vehicleRestrictionResultList.count > 0 { let topmostContent = vehicleRestrictionResultList[0] + let lat = topmostContent.coordinates.latitude + let lon = topmostContent.coordinates.longitude // Note that the text property is empty for general truck restrictions. - self.showDialog(title: "Vehicle restriction picked", message: "Type: \(topmostContent.restrictionType). \(topmostContent.text )") + self.showDialog(title: "Vehicle restriction picked", message: " Location: \(lat), \(lon).") } } } @@ -796,7 +798,7 @@ class TruckGuidanceExample: TapDelegate, // Otherwise, a SearchError.FORBIDDEN will occur. _ = searchEngine.setCustomOption(name: "show", value: "truck") - searchEngine.search(categoryQuery: categoryQuery, options: searchOptions, completion: { (searchError, items) in + searchEngine.searchByCategory(categoryQuery, options: searchOptions, completion: { (searchError, items) in if let searchError = searchError { print("No places found along the route. Error: \(searchError)") return