Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QR Detection Only Works Once Per Session #244

Open
Yrban opened this issue Feb 5, 2021 · 0 comments
Open

QR Detection Only Works Once Per Session #244

Yrban opened this issue Feb 5, 2021 · 0 comments

Comments

@Yrban
Copy link

Yrban commented Feb 5, 2021

When I trigger the QR detection via the following code, it will only read one QR code. My code:

    fileprivate func startQRCodeDetection() {
        cameraManager.startQRCodeDetection { (result) in
            switch result {
            case .success(let value):
                qrString = value
            case .failure(let error):
                NSLog("\ncameraManager.startQRCodeDetection failed with error %@", error.localizedDescription)
            }
        }
        qrScannerIsActive = true
    }
    
    fileprivate func stopQRCodeDetection() {
        cameraManager.stopQRCodeDetection()
        qrScannerIsActive = false
        qrString = nil
    }

I think I traced one issue to stopQRCodeDetection() in CameraManager. Line 821 fails and I otherwise can't see where qrOutput is ever set to anything from nil, therefore, line 822, captureSession?.removeOutput(output) is not called. I am not sure that that is the root of my problem that I am seeing, but it may need addressing. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant