Skip to Content
API ReferenceiOS SDKGraffityARCloud

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

MemberResult / typeContract
init(configuration: GraffityARCloudConfiguration) throwsNew sessionValidates the token’s basic format; malformed input throws .invalidAccessToken. Starts the experience when its view appears.
static let versionString"5.1.1" in the inspected source.
static let buildNumberInt5_001_001 in the inspected source.
weak var delegateGraffityARCloudDelegate?Optional event receiver; retain it in the host.

See configuration and delegate.

View factories

MethodReturn typeContract
makeViewController()UIViewControllerUIKit host owned by the caller; present it or use complete child containment.
makeSwiftUIView()some ViewSwiftUI 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

MemberTypeContract
var stateGraffityARStateCurrent immutable snapshot; read-only.
var statePublisherAnyPublisher<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

MethodContract
startNavigation(to poiId: String) async throwsResolves 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() asyncResets localization through the last UIKit factory-created controller after its view loads. Currently ineffective for the public SwiftUI factory.
shutdown() asyncIdempotent 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.