State and navigation values
All types on this page require iOS 18.0+ and conform to Sendable and Equatable. State values are immutable; the SDK constructs snapshots, which hosts receive through state, Combine, AsyncStream, or delegate callbacks.
GraffityARState
| Property | Type | Meaning |
|---|---|---|
isSceneReady | Bool | Camera/AR scene bootstrapping completed. Does not imply VPS localization. |
vpsState | GraffityARVPSState | Localization state. |
navigation | GraffityARNavigationState? | Active route state, or nil. |
lastError | GraffityARCloudError? | Most recent surfaced error, if any. |
Public construction is init(isSceneReady:vpsState:navigation:lastError:), with the types above and no default arguments.
GraffityARVPSState
| Case | Associated value / meaning |
|---|---|
.idle | Not yet attempting localization. |
.awaitingInitial | Waiting for the initial gravity-aligned view. |
.guiding(progress: Double) | Hold/capture guidance fraction from 0 to 1; 0 when hover capture is off. |
.localized(sectionId: String) | Successfully localized section. |
.failed(GraffityARCloudError) | Failed localization. |
GraffityARNavigationState
| Property | Type | Meaning |
|---|---|---|
destinationId | String | Final destination ID, including during section transitions. |
destinationName | String | Localized final destination name. |
action | GraffityARNavigationAction | Current leg’s next instruction. |
distanceToDestinationMeters | Double | Distance to this leg’s target; mid-journey this can be a transition POI. |
distanceToNextActionMeters | Double? | Reserved for next-action distance; the current state bridge always publishes nil. |
Public construction is init(destinationId:destinationName:action:distanceToDestinationMeters:distanceToNextActionMeters:), with the types above and no defaults.
Do not infer final arrival from .arriving alone during a multi-section journey; use didArriveAt. A currently unavailable leg distance can be published as 0.
GraffityARNavigationAction
A String-backed enum, also CaseIterable:
| Case / raw value | Instruction |
|---|---|
forward | Continue forward. |
turnLeft | Turn left. |
turnRight | Turn right. |
goUp | Take an upward transition. |
goDown | Take a downward transition. |
arriving | Reaching the current leg’s target. |