Skip to content

Commit

Permalink
Activate scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelete committed Sep 2, 2024
1 parent 420eab3 commit 4cc7566
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions BluFiExample/QRScannerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public class QRCodeScannerController: UIViewController, AVCaptureMetadataOutputO

override public func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
//UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
delCnt = 0
prepareQRScannerView(self.view)
startScanningQRCode()
Expand Down Expand Up @@ -325,7 +325,10 @@ public class QRCodeScannerController: UIViewController, AVCaptureMetadataOutputO

open func startScanningQRCode() {
if captureSession.isRunning { return }
captureSession.startRunning()
//captureSession.startRunning()
DispatchQueue.global(qos: .background).async { [weak self] in
self?.captureSession.startRunning()
}
}

private func setupCaptureSession(_ devicePostion: AVCaptureDevice.Position) {
Expand Down

0 comments on commit 4cc7566

Please sign in to comment.