// // QRScanView.swift // XuXuCheck // // Created by henseycai on 2025/7/11. // import SwiftUI struct QRScanView: View { @State private var isPresentingScanner = false @State private var scannedCode: String? var body: some View { VStack(spacing: 10) { if let code = scannedCode { Text("result " + code) //NavigationLink("Next page", destination: NextView(scannedCode: code), isActive: .constant(true)).hidden() } Button("Scan Code") { isPresentingScanner = true } Text("Scan a QR code to begin") } .fullScreenCover(isPresented: $isPresentingScanner) { CodeScannerView(codeTypes: [.qr]) { response in if case let .success(result) = response { scannedCode = result.string isPresentingScanner = false } } } } }