I\'m currently using the below code to turn on and off my iPhone 4 LED light and it\'s working great, but the only problem is that every time I turn the LED on there is a sl
Do everything (all the session and device configuration stuff) except the flash configuration block before you want to turn the flash LED on, during app init or view load.
Then just set torch mode on when you want to turn the LED on. Something like:
[self.myDevice lockForConfiguration:nil];
[self.myDevice setTorchMode:AVCaptureTorchModeOn];
[self.myDevice setFlashMode:AVCaptureFlashModeOn];
[self.myDevice unlockForConfiguration];
Make sure that myDevice is a properly configured property during your init.
A bit necromantic, but here is a great Library to do it :
LARSTTorch