mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-07 14:53:35 +00:00
ListView: added flashHeaderItems
This commit is contained in:
parent
7d0164259f
commit
0d65c31ae1
@ -512,14 +512,18 @@ open class ListView: ASDisplayNode, UIScrollViewAccessibilityDelegate, UIGesture
|
||||
}
|
||||
}
|
||||
|
||||
private func resetHeaderItemsFlashTimer(start: Bool) {
|
||||
public func flashHeaderItems(duration: Double = 2.0) {
|
||||
self.resetHeaderItemsFlashTimer(start: true, duration: duration)
|
||||
}
|
||||
|
||||
private func resetHeaderItemsFlashTimer(start: Bool, duration: Double = 0.3) {
|
||||
if let flashNodesDelayTimer = self.flashNodesDelayTimer {
|
||||
flashNodesDelayTimer.invalidate()
|
||||
self.flashNodesDelayTimer = nil
|
||||
}
|
||||
|
||||
if start {
|
||||
let timer = Timer(timeInterval: 0.3, target: ListViewTimerProxy { [weak self] in
|
||||
let timer = Timer(timeInterval: duration, target: ListViewTimerProxy { [weak self] in
|
||||
if let strongSelf = self {
|
||||
if let flashNodesDelayTimer = strongSelf.flashNodesDelayTimer {
|
||||
flashNodesDelayTimer.invalidate()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user