Files
AsyncDisplayKit/_docs/cell-node.md
2016-05-01 17:50:04 -05:00

806 B
Executable File

title, layout, permalink, next
title layout permalink next
ASCellNode docs /docs/cell-node.html text-cell-node.html

ASCellNode is maybe the most commonly subclassed node. It can be used as the cell for both ASTableNodes and ASCollectionNodes.

That being said, subclassing it is largely the same as subclassing a regular ASDisplayNode. Most importantly, you'll write an -init method, a -layoutSpecThatFits: method for measurement and layout, and, if necessary, a -didLoad method for adding extra gesture recognizers and a -layout method for any extra layout needs.

If you don't feel like subclassing you're also free to use the -initWithView: or -initWithViewController: methods to return nodes with backing views created from an existing view or view controller you already have.