AVCaptureDevice *Devic=[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([Devic hasTorch]) {
[Devic lockForConfiguration:nil];
[Devic setTorchMode:AVCaptureTorchModeOn];
[Devic unlockForConfiguration];
}
关闭手电筒
AVCaptureDevice *Device=[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
if ([Device hasTorch]) {
[Device lockForConfiguration:nil];
[Device setTorchMode:AVCaptureTorchModeOff];
[Device unlockForConfiguration];
}