Open ximplia-paolo-pasianot opened 6 months ago
Hello,
I am new in IOS too.
I think the QR code reading screen freezes because your code takes control of the Camere Hardware, and the CodeScannerView loses the Camera control, so CodeScannerView freezes.
The Flashlight capability is implemented in CodeScannerView. Try this:
struct QRCodeScannerView: View { .... @State private var isFlashlightOn = false .... .sheet(isPresented: $isPresentingScanner) { CodeScannerView(codeTypes: [.qr], showViewfinder: true, isTorchOn: isFlashlightOn) ... Button("Flashlight"){ if isFlashlightOn { isFlashlightOn = false }else{ isFlashlightOn = true } }
Adding a button in the sheet works fine for me.
Good morning, I want to preface by saying that I'm not an experienced Swift and iOS programmer, but I think I've found a bug with the flashlight. I've implemented the QR code reading library and added a button to toggle the flashlight on and off. However, when I activate the flashlight, the QR code reading screen freezes.
Thank you very much for the time you've dedicated to me.