Created
February 28, 2018 07:06
-
-
Save nkmrh/acf7d82c060cf4887dd8e1d79f3a20f8 to your computer and use it in GitHub Desktop.
Torch workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try? videoDevice.lockForConfiguration() | |
if newValue > 0.1 { | |
try? videoDevice.setTorchModeOn(level: newValue) | |
} else { | |
videoDevice.torchMode = .off | |
} | |
videoDevice.unlockForConfiguration() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment