Add hideTimer to RunLoop's common modes.
arror opened this issue · 2 comments
arror commented
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)
}
PGLongo commented
Can you add an explanation?
buyu03 commented
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