A SwiftUI wrapper around UIAction.captureTextFromCamera
Install via Swift Package Manager:
https://github.com/chFlorian/ScanTextField
The package contains a single UIViewRepresentable, that can be used anywhere in a SwiftUI View:
import ScanTextField
struct ContentView: View {
@State var text = ""
var body: some View {
VStack {
ScanTextField("Enter name", text: $text)
.padding(8)
.frame(height: 30)
.background(Color(.lightGray).opacity(0.2))
.cornerRadius(10)
.padding(.horizontal)
}
}
}