Created
March 3, 2012 16:35
-
-
Save pablasso/1966906 to your computer and use it in GitHub Desktop.
Control iOS device torch (flash)
This file contains hidden or 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
AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; | |
if ([device hasTorch]) { | |
[device lockForConfiguration:nil]; | |
[device setTorchMode:AVCaptureTorchModeOn]; // AVCaptureTorchModeOff | |
[device unlockForConfiguration]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment