2020-02-13 13:14:42 +01:00

29 lines
755 B
Swift

import Foundation
import UIKit
import AsyncDisplayKit
open class ASImageNode: ASDisplayNode {
public var image: UIImage? {
didSet {
if self.isNodeLoaded {
if let image = self.image {
let capInsets = image.capInsets
if capInsets.left.isZero && capInsets.top.isZero {
ASDisplayNodeSetResizableContents(self, image)
} else {
self.contents = self.image?.cgImage
}
} else {
self.contents = nil
}
}
}
}
public var displayWithoutProcessing: Bool = true
override public init() {
super.init()
}
}