This snapshot establishes the camera-to-result recognition flow and related tests while checking in the project skill/docs assets required for the configured local tooling.
40 lines
1.0 KiB
Swift
40 lines
1.0 KiB
Swift
//
|
|
// ContentView.swift
|
|
// StackDex
|
|
//
|
|
// Created by Matthias Meister on 18.04.26.
|
|
//
|
|
|
|
import SwiftData
|
|
import SwiftUI
|
|
|
|
struct ContentView: View {
|
|
@StateObject private var flowModel = ScanFlowModel()
|
|
|
|
var body: some View {
|
|
NavigationStack(path: $flowModel.path) {
|
|
ScanView(flowModel: flowModel)
|
|
.navigationDestination(for: ScanRoute.self) { route in
|
|
switch route {
|
|
case .result:
|
|
ResultEditorView(flowModel: flowModel, mode: .recognized)
|
|
case .manual:
|
|
ResultEditorView(flowModel: flowModel, mode: .manual)
|
|
}
|
|
}
|
|
.task {
|
|
flowModel.startObservers()
|
|
await flowModel.prepareVisibleServices()
|
|
}
|
|
.onDisappear {
|
|
flowModel.stopObservers()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
ContentView()
|
|
.modelContainer(for: ConfirmedScanRecord.self, inMemory: true)
|
|
}
|