Skip to main content
Version: 0.2.0

Events and handles

Each screen reports through one onEvent closure, and each event carries the handle for the next screen — so navigation is a switch.

Event enums grow

New cases arrive in minor versions. Keep a default in exhaustive switches.

Handles​

Property, Floor and Room are opaque references. They arrive in events, or from createProperty(name:floorCount:metadata:) / property(id:), and go straight back into a factory.

You cannot construct one, by design — a hand-built handle could only name a row that doesn't exist.

TypeProperties
Propertyid: String, name: String
Floorid: String, name: String?, number: Int?, propertyId: String
Roomid: String, name: String?, floorId: String

All three are Equatable. Store Property.id next to your own record to reopen it on a later launch.

PropertyListEvent​

CaseMeaning
selectProperty(Property)The user picked a property
failed(NoughtyToursError)A write the screen performed failed

PropertyEvent​

CaseMeaning
selectFloor(Floor)Drill into a floor
selectRoom(Room)Drill into a room
startStructureCapture(Floor)Push the structure-capture flow
continueStructureCapture(Floor)Push the structure-capture flow with .continueScan — add rooms to the plan this floor already has
startPanoramaCapture(Floor)Push panorama capture for the floor
failed(NoughtyToursError)A write the screen performed failed

FloorEvent​

CaseMeaning
selectRoom(Room)Drill into a room
startStructureCapture(Floor)Push the structure-capture flow
continueStructureCapture(Floor)Push the structure-capture flow with .continueScan — add rooms to the plan this floor already has
startPanoramaCapture(Floor)Push panorama capture for the floor

Both events carry the same handle and go to the same factory; only the mode differs. continueStructureCapture is raised only for a floor whose plan can actually be continued, so a host that does not want to offer it can ignore the case.

RoomEvent​

CaseMeaning
startPanoramaCapture(Room)Push panorama capture for the room

StructureCaptureEvent​

CaseMeaning
finishedDone. The flow pops itself back — do nothing
cancelledBacked out. Pop the flow yourself
redoRequestedBuild a fresh flow for the same floor. Never raised for .continueScan

PanoramaCaptureEvent​

CaseMeaning
finished(Floor, capturedInSession: Int)Count is for this visit, not the floor total, and excludes scans the SDK discarded
cancelledBacked out. The screen has already popped itself — do not pop again. Anything captured before that is kept

Where errors reach you​

Two paths, and they mean different things:

  • Thrown from a factory, before you have a screen — the entity was gone, the read failed, or the device can't capture. Nothing is on screen yet, so you decide what to show.
  • Reported through failed — a write the screen performed on its own failed while the user was looking at it. The screen has already dismissed anything it was presenting.

See Errors.