1

I am Programing an application for iOS TorchLight in Objective-C, I've visited many code snippets, but not find any single complete code snipet, as I needs complete guideline starting from xib file, as I've two images for button when button is in normal state image1 displayed at button, and when button is in pressed state image2 displayed in button.

Thanks in advanced.

Faiz Fareed
  • 1,498
  • 1
  • 14
  • 31

1 Answers1

2

in your AVCaptureDevice you can use these

AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([device hasTorch])  
{
  [device lockForConfiguration:nil];
  //by these you can use Torch Flash Light..
  [device setTorchMode:AVCaptureTorchModeOn];  // use AVCaptureTorchModeOff to turn off
  [device unlockForConfiguration];
}

and you should also refer these

https://github.com/robovm/apple-ios-samples/tree/master/AVCamManualUsingtheManualCaptureAPI

krushnsinh
  • 874
  • 1
  • 10
  • 11
  • I've read & tried my best to implement following code in my app but still I needs more assistance from start to end that how to perform overall tasks step by step. http://stackoverflow.com/questions/3190034/turn-on-torch-flash-on-iphone?rq=1 – Faiz Fareed Aug 28 '15 at 13:10