CodeScanner
CodeScanner copied to clipboard
Landscape mode shows wrong orientation for a split second in .sheet()
I'm adding CodeScanner into a .sheet() for my iPad app that is primarily in landscape mode. When the sheet appears, the camera is briefly shown rotated 90 degrees, and then it fixes itself within a second. Was wondering if there's a simple fix for this.
Here is my setup:
VStack {
Button(action: { showModal.toggle() }, label: { Text("Button") })
}
.sheet(isPresented: $showModal, content: {
VStack {
CodeScannerView(codeTypes: [.qr], videoCaptureDevice: AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .front)) { response in
print(response)
}
}
})