Skip to content

Commit

Permalink
Merge pull request #338 from heremaps/esd/41940
Browse files Browse the repository at this point in the history
Update example apps for release 4.19.4.0
  • Loading branch information
abhiditi committed Aug 27, 2024
2 parents 5ef88aa + 14b6f78 commit 818a3be
Show file tree
Hide file tree
Showing 131 changed files with 3,064 additions and 3,924 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For an overview of the existing features, please check the _Developer Guide_ for

> For now, the _Navigate Edition_ is only available upon request. Please contact your HERE representative to receive access including a set of evaluation credentials.
## List of Available Example Apps (Version 4.19.3.0)
## List of Available Example Apps (Version 4.19.4.0)

- **HelloMap**: Shows the classic 'Hello World'.
- **HelloMapKotlin**: Shows the classic 'Hello World' using Kotlin language (Android only).
Expand Down
2 changes: 1 addition & 1 deletion examples/latest/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This folder contains the HERE SDK examples apps for version: 4.19.3.0
This folder contains the HERE SDK examples apps for version: 4.19.4.0

- HERE SDK for Android ([Lite Edition](lite/android/), [Explore Edition](explore/android/), [Navigate Edition](navigate/android/))
- HERE SDK for iOS ([Lite Edition](lite/ios/), [Explore Edition](explore/ios/), [Navigate Edition](navigate/ios/))
Expand Down
241 changes: 118 additions & 123 deletions examples/latest/explore/ios/Camera/Camera.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"colors" : [
{
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -18,20 +18,34 @@
*/

import heresdk
import UIKit
import SwiftUI

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
// This class is the entry point to an application.
// HERE SDK initialization is done at start of app. When app is terminated, the HERE SDK is disposed.
@main
struct CameraApp: App {

var body: some Scene {
WindowGroup {
ContentView()
}
}

init() {
observeAppLifecycle()

// Usually, you need to initialize the HERE SDK only once during the lifetime of an application.
initializeHERESDK()

return true
}

private func observeAppLifecycle() {
NotificationCenter.default.addObserver(forName: UIApplication.willTerminateNotification,
object: nil,
queue: nil) { _ in
// Perform cleanup or final tasks here.
print("App is about to terminate.")
disposeHERESDK()
}
}

private func initializeHERESDK() {
Expand All @@ -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()
}
}
32 changes: 26 additions & 6 deletions examples/latest/explore/ios/Camera/Camera/CameraExample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ import UIKit
class CameraExample: TapDelegate, MapCameraDelegate {

private let defaultDistanceToEarthInMeters: Double = 8000
private let viewController: UIViewController
private let mapView: MapView
private let camera: MapCamera
private var cameraTargetView: UIImageView
private var poiMapCircle: MapPolygon!

init(viewController: UIViewController, mapView: MapView) {
self.viewController = viewController
init(_ mapView: MapView) {
self.mapView = mapView

// Configure the map.
camera = mapView.camera
let distanceInMeters = MapMeasure(kind: .distance, value: defaultDistanceToEarthInMeters)
camera.lookAt(point: GeoCoordinates(latitude: 52.750731,longitude: 13.007375),
Expand All @@ -56,9 +55,19 @@ class CameraExample: TapDelegate, MapCameraDelegate {
mapView.gestures.tapDelegate = self
mapView.camera.addDelegate(self)

// Load the map scene using a map scheme to render the map with.
mapView.mapScene.loadScene(mapScheme: MapScheme.normalDay, completion: onLoadScene)

showDialog(title: "Note", message: "Tap the map to set a new transform center.")
}

// Completion handler for loadScene().
private func onLoadScene(mapError: MapError?) {
if let mapError = mapError {
print("Error: Map scene not loaded, \(String(describing: mapError))")
}
}

func onRotateButtonClicked() {
rotateMap(bearingStepInDegrees: 10)
}
Expand Down Expand Up @@ -164,8 +173,19 @@ class CameraExample: TapDelegate, MapCameraDelegate {
}

private func showDialog(title: String, message: String) {
let alertController = UIAlertController(title: title, message: message, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
viewController.present(alertController, animated: true, completion: nil)
if let topController = UIApplication.shared.windows.first?.rootViewController {
let alert = UIAlertController(
title: title,
message: message,
preferredStyle: .alert
)

alert.addAction(UIAlertAction(title: "OK", style: .default, handler: { _ in
// Handle OK button action.
alert.dismiss(animated: true, completion: nil)
}))

topController.present(alert, animated: true, completion: nil)
}
}
}
Loading

0 comments on commit 818a3be

Please sign in to comment.