mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-08-26 15:31:12 +00:00
32 lines
799 B
Swift
32 lines
799 B
Swift
import Foundation
|
|
#if os(macOS)
|
|
#else
|
|
import AsyncDisplayKit
|
|
#endif
|
|
|
|
final class ListViewOverscrollBackgroundNode: ASDisplayNode {
|
|
private let backgroundNode: ASDisplayNode
|
|
|
|
var color: UIColor {
|
|
didSet {
|
|
self.backgroundNode.backgroundColor = color
|
|
}
|
|
}
|
|
|
|
init(color: UIColor) {
|
|
self.color = color
|
|
|
|
self.backgroundNode = ASDisplayNode()
|
|
self.backgroundNode.backgroundColor = color
|
|
self.backgroundNode.isLayerBacked = true
|
|
|
|
super.init()
|
|
|
|
self.addSubnode(self.backgroundNode)
|
|
}
|
|
|
|
func updateLayout(size: CGSize, transition: ContainedViewLayoutTransition) {
|
|
transition.updateFrame(node: self.backgroundNode, frame: CGRect(origin: CGPoint(), size: size))
|
|
}
|
|
}
|