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.
| Type | Properties |
|---|---|
Property | id: String, name: String |
Floor | id: String, name: String?, number: Int?, propertyId: String |
Room | id: 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
| Case | Meaning |
|---|---|
selectProperty(Property) | The user picked a property |
failed(NoughtyToursError) | A write the screen performed failed |
PropertyEvent
| Case | Meaning |
|---|---|
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
| Case | Meaning |
|---|---|
selectRoom(Room) | Drill into a room |
startStructureCapture(Floor) | Push the structure-capture flow |
startPanoramaCapture(Floor) | Push panorama capture for the floor |
RoomEvent
| Case | Meaning |
|---|---|
startPanoramaCapture(Room) | Push panorama capture for the room |
StructureCaptureEvent
| Case | Meaning |
|---|---|
finished | Done. The flow pops itself back — do nothing |
cancelled | Backed out. Pop the flow yourself |
redoRequested | Build a fresh flow for the same floor |
PanoramaCaptureEvent
| Case | Meaning |
|---|---|
finished(Floor, capturedInSession: Int) | Count is for this visit, not the floor total |
cancelled | Backed 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.