GraffityARCloud
@MainActor public final class GraffityARCloud
The session entry point. Retain one instance per logical AR experience and keep one active hosted view per instance. All members below require iOS 18.0+.
Initialization and identity
| Member | Result / type | Contract |
|---|---|---|
init(configuration: GraffityARCloudConfiguration) throws | New session | Validates the token’s basic format; malformed input throws .invalidAccessToken. Starts the experience when its view appears. |
static let version | String | "5.1.1" in the inspected source. |
static let buildNumber | Int | 5_001_001 in the inspected source. |
weak var delegate | GraffityARCloudDelegate? | Optional event receiver; retain it in the host. |
See configuration and delegate.
View factories
| Method | Return type | Contract |
|---|---|---|
makeViewController() | UIViewController | UIKit host owned by the caller; present it or use complete child containment. |
makeSwiftUIView() | some View | SwiftUI host owned by the caller; keep the SDK in a stable owner. |
The underlying concrete types are internal. There is no public scene, node, custom-anchor, or ARKit-session accessor. See presentation examples.
State
| Member | Type | Contract |
|---|---|---|
var state | GraffityARState | Current immutable snapshot; read-only. |
var statePublisher | AnyPublisher<GraffityARState, Never> | Current snapshot followed by changes, with duplicate filtering. |
stateStream() | AsyncStream<GraffityARState> | Independent stream per call; current snapshot followed by changes. Cancel the observing task at teardown. |
Streams do not currently finish on shutdown. See observation examples.
Controls
| Method | Contract |
|---|---|
startNavigation(to poiId: String) async throws | Resolves a loaded active-section POI and requests navigation. An unknown or unavailable POI throws .navigationGraphUnavailable; observe later route errors through delegate/state. |
stopNavigation() | Clears active navigation; does not reopen the destination picker. |
reset() async | Resets localization through the last UIKit factory-created controller after its view loads. Currently ineffective for the public SwiftUI factory. |
shutdown() async | Idempotent terminal teardown. Remove the hosted view too, especially for the current SwiftUI path. Create a fresh SDK afterward. |
setLogger(_ logger: GraffityARLogger?) | Replaces the sink; nil restores the default. Keeps the configured minimum severity. |
setTelemetryEnabled(_ enabled: Bool) | Enables/disables analytics at runtime. Initial telemetry defaults to off. |
See navigation, lifecycle limitations, and logging and telemetry.