minor fix on threading issue

This commit is contained in:
ryanzhao 2022-09-13 15:12:42 +10:00
parent 2e67bc9374
commit 747695c39b
2 changed files with 6 additions and 7 deletions

View file

@ -115,7 +115,10 @@ NS_ASSUME_NONNULL_BEGIN
self.capture.layer.frame = self.view.bounds;
[self.view.layer addSublayer:self.capture.layer];
[self.view bringSubviewToFront:self.maskingView];
[self.capture start];
dispatch_async(self.captureQueue, ^{
[self.capture start];
});
});
});
} else {

View file

@ -67,9 +67,7 @@ final class ScanQRCodeWrapperVC : BaseVC {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
UIDevice.current.ows_setOrientation(.portrait)
DispatchQueue.main.async { [weak self] in
self?.scanQRCodeVC.startCapture()
}
self.scanQRCodeVC.startCapture()
}
// MARK: Interaction
@ -78,8 +76,6 @@ final class ScanQRCodeWrapperVC : BaseVC {
}
public func startCapture() {
DispatchQueue.main.async { [weak self] in
self?.scanQRCodeVC.startCapture()
}
self.scanQRCodeVC.startCapture()
}
}