fix: async dispatch conditional

This commit is contained in:
Marc Rousavy 2021-06-03 15:41:43 +02:00
parent ca0c0e92e0
commit e5fe5ab175

View File

@ -197,8 +197,8 @@ public final class CameraView: UIView {
}
// This is a wack workaround, but if I immediately set torch mode after `startRunning()`, the session isn't quite ready yet and will ignore torch.
self.cameraQueue.asyncAfter(deadline: .now() + 0.1) {
if shouldUpdateTorch {
if shouldUpdateTorch {
self.cameraQueue.asyncAfter(deadline: .now() + 0.1) {
self.setTorchMode(self.torch)
}
}