Open arror opened 6 years ago
open func hide(afterDelay delay: TimeInterval, completion: TimerAction? = nil) { let key = UUID().uuidString let userInfo = ["timerActionKey": key] if let completion = completion { timerActions[key] = completion } hideTimer?.invalidate() hideTimer = Timer.scheduledTimer(timeInterval: delay, target: self, selector: #selector(PKHUD.performDelayedHide(_:)), userInfo: userInfo, repeats: false) }
Can you add an explanation?
hideTimer is in Default Mode of runloop, it should be added to Common Mode, otherwise, when scrollView slide, timer will stop