Closed nathanfallet closed 2 years ago
Adding an ability to turn on/off torch light.
This snippet can be used:
func torch(torchIsOn: Bool) -> CodeScannerView { if let backCamera = AVCaptureDevice.default(for: AVMediaType.video) { if backCamera.hasTorch { try? backCamera.lockForConfiguration() backCamera.torchMode = torchIsOn ? .on : .off backCamera.unlockForConfiguration() } } return self }
Note: if I have some free time next week, I will try to make a Pull Request for that
Adding an ability to turn on/off torch light.
This snippet can be used:
Note: if I have some free time next week, I will try to make a Pull Request for that