iOS调用系统手电筒

释放双眼,带上耳机,听听看~!
#import <AVFoundation/AVFoundation.h>
@property (nonatomic,strong) AVCaptureDevice *device;
-(void)Open:(UIButton *)sender{
sender.selected=!sender.selected;
self.device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
[self.device lockForConfiguration:nil];
if ([self.device hasFlash]) {
if(_device.torchMode==AVCaptureFlashModeOff) {
_device.torchMode=AVCaptureTorchModeOn;
}else if(_device.torchMode==AVCaptureFlashModeOn) {
_device.torchMode=AVCaptureTorchModeOff;
}
}
[self.device unlockForConfiguration];
}

人已赞赏
iOS文章

iOS开发者APP运行时Crash自动修复系统

2020-3-6 19:15:07

iOS文章

iOS上架报错ERROR ITMS-90717: "Invalid App Store Icon.

2020-3-6 19:56:08

个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
有新消息 消息中心
搜索