Swiftgram/submodules/Display/Display/ListViewOverscrollBackgroundNode.swift
Peter 8f5a4f7dc1 Add 'submodules/Display/' from commit '7bd11013ea936e3d49d937550d599f5816d32560'
git-subtree-dir: submodules/Display
git-subtree-mainline: 9bc996374ffdad37aef175427db72731c9551dcf
git-subtree-split: 7bd11013ea936e3d49d937550d599f5816d32560
2019-06-11 18:44:37 +01:00

30 lines
785 B
Swift

import Foundation
import UIKit
import AsyncDisplayKit
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))
}
}