Faiz Fareed
Faiz Fareed

Reputation: 1548

Torch Flash Light in iOS

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.

Upvotes: 1

Views: 1354

Answers (1)

krushnsinh
krushnsinh

Reputation: 864

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

Upvotes: 2

Related Questions