diff --git a/bindings/ios/demo/MaterialReaderDemo/DemoApp.swift b/bindings/ios/demo/MaterialReaderDemo/DemoApp.swift new file mode 100644 index 0000000..668309d --- /dev/null +++ b/bindings/ios/demo/MaterialReaderDemo/DemoApp.swift @@ -0,0 +1,75 @@ +import SwiftUI +import ZxDocumentRuntime + +/// Minimal demo app to verify zhixi-document-runtime integration. +@main +struct MaterialReaderDemo: App { + var body: some Scene { + WindowGroup { + ContentView() + } + } +} + +struct ContentView: View { + @State private var filePath = "" + @State private var result = "" + @State private var events: [ReadingEvent] = [] + + var body: some View { + NavigationStack { + List { + Section("File Type Detection") { + TextField("File path", text: $filePath) + .font(.system(size: 14, design: .monospaced)) + Button("Detect Type") { + detect() + } + if !result.isEmpty { + Text(result) + .font(.system(size: 14)) + .foregroundColor(.secondary) + } + } + + Section("Reading Events") { + if events.isEmpty { + Text("No events yet") + .foregroundColor(.secondary) + } else { + ForEach(0..