This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Dispatch | |
private var throttleItems = Atomic([AnyHashable: ThrottleItem]()) | |
private var debounceItems = Atomic([AnyHashable: DebounceItem]()) | |
extension DispatchQueue { | |
/// First action is executed, then other actions will be performed at most once per specified interval. | |
/// - Note: | |
/// Only the first call's `interval` is taken into account and updated every interval. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
import AVFoundation | |
class ViewController: UIViewController { | |
override func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) | |
switch AVCaptureDevice.authorizationStatus(for: .video) { | |
case .notDetermined: |