RoomioScanView

The scanning screen for a RoomioScanSession.

@MainActor struct RoomioScanView

Overview

Shows the camera and the scan as it builds, with the buttons to finish and to exit it: “Complete scan”, which calls stop(), and a close button that asks the user to confirm, then cancels the session. Watch state for RoomioScanState.finished and RoomioScanState.cancelled.

The view includes its own scanning guidance, which cannot be turned off: “Slow down” and “Tracking Lost” in the centre, and full storage, low memory, a low battery, a hot phone, Low Power Mode and tips such as moving slowly or finding more detail in a bar at the top. All of it is also reported through RoomioScanEvent.guidanceChanged(_:). Before the scan it shows the onboarding unless showsOnboarding is off; hide your own controls while isShowingOnboarding is true. When the scan starts it checks the device and may show a sheet first: camera access refused (“Open settings” or “Cancel”), Low Power Mode, full storage or a nearly flat battery (the scan can’t start), or low storage or battery (“Continue anyway” or a way out). Every way out of a sheet cancels the session. If a fault ends the scan while it is recording, the view tells the user in a dialog; the session is already RoomioScanState.failed(_:) by then. It also tells the user when saving or packaging the scan fails; you still get the error as before. Hide your own controls while isShowingDialog is true.

Pass a RoomioScanStyle to use your own colours.

The camera fills the screen behind the safe area by itself; don’t apply ignoresSafeArea() to the view, or its buttons move under the status bar and home indicator.

body

@MainActor var body: some View { get }

init(session:style:)

Create the scanning screen for a session.

@MainActor init(session: RoomioScanSession, style: RoomioScanStyle = RoomioScanStyle())
Roomio SDK 0.0.15