File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,10 @@ open class BarcodeScannerViewController: UIViewController {
4848 /// and waits for the next reset action.
4949 public var isOneTimeSearch = true
5050
51+ /// When the flag is set to `true` the screen is flashed on barcode scan.
52+ /// Defaults to true.
53+ public var shouldSimulateFlash = true
54+
5155 /// `AVCaptureMetadataOutput` metadata object types.
5256 public var metadata = AVMetadataObject . ObjectType. barcodeScannerMetadata {
5357 didSet {
@@ -198,6 +202,13 @@ open class BarcodeScannerViewController: UIViewController {
198202 - Parameter processing: Flag to set the current state to `.processing`.
199203 */
200204 private func animateFlash( whenProcessing: Bool = false ) {
205+ guard shouldSimulateFlash else {
206+ if whenProcessing {
207+ self . status = Status ( state: . processing)
208+ }
209+ return
210+ }
211+
201212 let flashView = UIView ( frame: view. bounds)
202213 flashView. backgroundColor = UIColor . white
203214 flashView. alpha = 1
You can’t perform that action at this time.
0 commit comments