Torch is Swift (iOS) Library which helps to control the device's flashlight.
To install Torch with Carthage, setup Carthage for your project as described in the Quick Start.
Then add this line to your Cartfile:
github "cpageler93/Torch" ~> 0.2.0
let isAvailable = Torch.isAvailable() // Bool// 100%
Torch.setTorch(to: 1.0)
// 50%
Torch.setTorch(to: 0.5)
// 0%
Torch.setTorch(to: 0.0)// set torch to 50% for 20 seconds
// after 20 seconds the torch resets it's state to the value before
Torch.setTorch(to: 0.5, duration: 20)// blinks 5 times, each blink lasts 0.2 seconds, the gap between each blink is also 0.2
Torch.blink(5, duration: 0.2, gap: 0.2)Please submit an issue on GitHub.
This project is licensed under the terms of the MIT license. See the LICENSE file.