We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I am facing issue in my project, app got crashed because didCaptureCode delegate gets called multiple times
didCaptureCode delegate
The text was updated successfully, but these errors were encountered:
Small workaround to fix issue:
var vcPushed = false
override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) vcPushed = false if (barcodeScanner.isCapturing == false) { barcodeScanner.startCapturing() } } override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) if barcodeScanner.isCapturing { barcodeScanner.stopCapturing() } } func quickScanner(_ scanner: QuickScanner, didCaptureCode code: String, type: CodeType) { DispatchQueue.main.async { if !self.vcPushed { self.vcPushed = true print("Barcode: " + code) self.productCode = code //Do further process AudioServicesPlaySystemSound(SystemSoundID(kSystemSoundID_Vibrate)) scanner.stopCapturing() self.performSegue(withIdentifier: "ProductDetailsViewController", sender: self) } } }
Hope it helps someone.
Sorry, something went wrong.
No branches or pull requests
Hi, I am facing issue in my project, app got crashed because
didCaptureCode delegate
gets called multiple timesThe text was updated successfully, but these errors were encountered: