ASNetworkImageNode
let imageNode = ASNetworkImageNode()
imageNode.url = URL(string: "https://someurl.com/image_uri")NetworkImageNode의 레이아웃 잡기
Option 1: .style.preferredSize
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {
imageNode.style.preferredSize = CGSize(width: 100, height: 200)
...
return finalLayoutSpec
}Option 2: ASRatioLayoutSpec
override func layoutSpecThatFits(_ constrainedSize: ASSizeRange) -> ASLayoutSpec {
let ratio: CGFloat = 3.0/1.0
let imageRatioSpec = ASRatioLayoutSpec(ratio:ratio, child:self.imageNode)
...
return finalLayoutSpec
}이면
Progressive JPEG 지원
자동 캐싱
GIF 지원
Image Downloader 에 URLSessionConfiguration 추가하기
Last updated
Was this helpful?