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
BarcodeScannerController
REPRO STEPS:
ACTUAL: flashlight symbol is greyed out!
EXPECTED: not greyed out
Code we use to call it:
let barcodeController = BarcodeScannerController() barcodeController.codeDelegate = self barcodeController.errorDelegate = self barcodeController.dismissalDelegate = self appDelegate = UIApplication.shared.delegate as! AppDelegate if UIDevice.current.orientation == UIDeviceOrientation.landscapeLeft { appDelegate.barCodeScannerOrientation = .landscapeRight } else { appDelegate.barCodeScannerOrientation = .landscapeLeft } barcodeController.reset() if let strongself = self { if AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) == AVAuthorizationStatus.authorized { // Already Authorized strongself.present(barcodeController, animated: true, completion: nil) } else if AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) == AVAuthorizationStatus.notDetermined { AVCaptureDevice.requestAccess(forMediaType: AVMediaTypeVideo, completionHandler: { (granted: Bool) -> Void in if granted == true { // User granted DispatchQueue.main.async { strongself.present(barcodeController, animated: true, completion: nil) } } }) } else if AVCaptureDevice.authorizationStatus(forMediaType: AVMediaTypeVideo) == AVAuthorizationStatus.denied { let alertController = UIAlertController(title: "Camera Access", message: "The camera permission was not authorized. Please enable it in Settings to continue.", preferredStyle: .alert) let settingsAction = UIAlertAction(title: "Settings", style: .default) { (alertAction) in if let appSettings = NSURL(string: UIApplicationOpenSettingsURLString) { UIApplication.shared.openURL(appSettings as URL) } } alertController.addAction(settingsAction) let cancelAction = UIAlertAction(title: "Cancel", style: .cancel, handler: nil) alertController.addAction(cancelAction) strongself.present(alertController, animated: true, completion: nil) } }
The text was updated successfully, but these errors were encountered:
FIXED
Found that we were retaining the BarcodeScannerController b/c of the scope - moved it into the block and all was good.
Thanks!
Sorry, something went wrong.
@jonchui glad you solved it 👍
No branches or pull requests
REPRO STEPS:
BarcodeScannerController
ACTUAL:
![image](https://user-images.githubusercontent.com/204868/30676023-af16b2b8-9e1f-11e7-9f2d-9793801100b8.png)
flashlight symbol is greyed out!
EXPECTED:
not greyed out
Code we use to call it:
The text was updated successfully, but these errors were encountered: