mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Temp
This commit is contained in:
31
submodules/Display/Source/Nodes/ASImageNode.swift
Normal file
31
submodules/Display/Source/Nodes/ASImageNode.swift
Normal file
@@ -0,0 +1,31 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import AsyncDisplayKit
|
||||
|
||||
private final class ASImageNodeView: UIImageView {
|
||||
|
||||
}
|
||||
|
||||
open class ASImageNode: ASDisplayNode {
|
||||
public var image: UIImage? {
|
||||
didSet {
|
||||
if self.isNodeLoaded {
|
||||
(self.view as? ASImageNodeView)?.image = self.image
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override public init() {
|
||||
super.init()
|
||||
|
||||
self.setViewBlock({
|
||||
return ASImageNodeView(frame: CGRect())
|
||||
})
|
||||
}
|
||||
|
||||
override open func didLoad() {
|
||||
super.didLoad()
|
||||
|
||||
(self.view as? ASImageNodeView)?.image = self.image
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user