Skip to main content

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
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
startPanoramaCapture(Floor)Push panorama capture for the floor

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

PanoramaCaptureEvent

CaseMeaning
finished(Floor, capturedInSession: Int)Count is for this visit, not the floor total
cancelledBacked out. 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.