We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1e0ab88 commit 8911fdeCopy full SHA for 8911fde
Sources/Control/Flashlight.swift
@@ -46,6 +46,16 @@ extension Control.Flashlight {
46
}
47
48
49
+ public static func blink(count: Int = 1, interval: TimeInterval = 0.1) {
50
+ Task {
51
+ for _ in 0..<count {
52
+ toggle()
53
+ try? await Task.sleep(nanoseconds: UInt64(1e+9 * interval))
54
55
+ }
56
57
58
+
59
private static var deviceWithFlashlight: AVCaptureDevice? {
60
guard
61
let device = AVCaptureDevice.default(for: .video),
0 commit comments