SceneAuthoringView
public struct SceneAuthoringView : View
Provides the flow for authoring an AR Annotation Scene. Used to create the content for the cards, select an anchor Image, and position the entities in their real world locations. Publishing the scene using Mobile Services with an SAPURLSession.
The onSceneEdit modifier provides a callback on editing events. When a scene was published, i.e. created or updated in SAP Mobile Services, then .published(sceneID)
is called and returns the technical id of the scene.
Usage
SceneAuthoringView(title: "Car Engine",
serviceURL: URL(string: IntegrationTest.System.redirectURL)!,
sapURLSession: sapURLSession,
sceneIdentifier: SceneIdentifyingAttribute.id(IntegrationTest.TestData.sceneId)) // Alternative Scene: 20110993
.onSceneEdit { sceneEdit in
switch sceneEdit {
case .created(card: let card):
print("Created: \(card.title_)")
case .updated(card: let card):
print("Updated: \(card.title_)")
case .deleted(card: let card):
print("Deleted: \(card.title_)")
case .published(sceneID: let sceneID):
print("From SceneEdit:", sceneID)
}
}
-
Initializer
Declaration
Swift
public init(title: String, serviceURL: URL, sapURLSession: SAPURLSession, sceneIdentifier: SceneIdentifyingAttribute? = nil)
Parameters
title
Title of the Scene
serviceURL
Server URL for your application in SAP Mobile Services
sapURLSession
SAPURLSession to provide credentials to Mobile Services
sceneIdentifier
Pass nil to create a new scene. To update a a scene you have to supply the identifier used in SAP Mobile Servcies to identify the scene.
-
SwiftUI’s view body
Declaration
Swift
public var body: some View { get }