How to control the flash light(iOS platform)
来源:互联网 发布:mac pro 贴膜涂层脱落 编辑:程序博客网 时间:2024/05/01 11:58
static int i = 0;- (IBAction)longAction:(UIDoubleTapRecogenizer *)sender { AVCaptureDevice *device = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo]; if (i % 2 == 0) { if ([device hasTorch]) { [device lockForConfiguration:nil]; [device setTorchMode: AVCaptureTorchModeOn]; [device unlockForConfiguration]; } } else { if ([device hasTorch]) { [device lockForConfiguration:nil]; [device setTorchMode: AVCaptureTorchModeOff]; [device unlockForConfiguration]; } } i++; }
Thesedays, I need to add a function to my iOS project. I need to add a function that we users double tap the screen, the flash light will be lighten up. How to complete it?
The source code can be found as follows:
0 0
- How to control the flash light(iOS platform)
- How to flash the recovery
- How to share text to Message in the app you are building(iOS platform)
- JS: How to control the IE(keyDown...)?
- 权限管理 how to control the authorization?
- How to control the jobs with shell?
- How to use the Segmented Control
- how to control the log4j output
- how to install the chrome in the Ubuntu platform
- The flash light year
- How to use softvol to control the master volume
- How to use softvol to control the master volume
- How to compile VLC on Linux Platform (From the authority)
- How To Change the Background Color of a Tab Control
- how to get the value of an control
- How to print the content of a Rich Edit Control
- In RadGrid, How to get the control inside usercontrol
- How to host WPF Control into the Windows Form Application
- 通过博客文章中人称的变换,可以看出文章的密级。。。
- java多线程与并发
- 简单的内存池
- 有机会有声有色
- Review of Codeforces 5C. Longest Regular Bracket Sequence
- How to control the flash light(iOS platform)
- all the questions about binary trees
- Sensor信号输出YUV、RGB、RAW DATA、JPEG 4种方式区别
- Android自定义View实现HTML图文环绕效果
- Leetcode: Palindrome Partitioning
- stack--Longest Valid Parentheses
- Activity的task相关
- Ubuntu下tar.gz文件安装方法
- Java之WeakReference与SoftReference使用讲解