Code snippet: Using AVCaptureDevice to access Torch

Every iOS device has the ability to be used as a torch. Developers have access to use this torch through AVCaptureDevice. You can copy this function into your app and using the setTorch boolean parameter, you can switch it on and off. You can also adjust the level of intensity on the torch by adjusting the setTorchModeOn parameter anywhere between 0 and 1 (maximum).

https://gist.github.com/rtking1993/3e251fc1556f91dd1bc3eb006bbd416b

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *