Skip to content

Instantly share code, notes, and snippets.

@GeekTree0101
Created May 28, 2019 08:01
Show Gist options
  • Save GeekTree0101/cc5ec9f5cd3780460cca82872c69f3ef to your computer and use it in GitHub Desktop.
Save GeekTree0101/cc5ec9f5cd3780460cca82872c69f3ef to your computer and use it in GitHub Desktop.
Case B
class CellNode: ASCellNode {
let contentNode = ASDisplayNode()
override init() {
super.init()
self.ASM = true
self.contentNode.ASM = true
self.contentNode.layoutSpecBlock = { [unowned self] _ -> ASLayoutSpec in
return self.contentLayoutSpec()
}
}
override func layoutSpecThatFits() -> ASLayoutSpec {
return ASInsetLayoutSpec(insets: .zero, child: contentNode)
}
func contentLayoutSpec() -> ASLayoutSpec {
return ASLayoutSpec()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment