简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM