Peter 9bc996374f Add 'submodules/AsyncDisplayKit/' from commit '02bedc12816e251ad71777f9d2578329b6d2bef6'
git-subtree-dir: submodules/AsyncDisplayKit
git-subtree-mainline: d06f423e0ed3df1fed9bd10d79ee312a9179b632
git-subtree-split: 02bedc12816e251ad71777f9d2578329b6d2bef6
2019-06-11 18:42:43 +01:00

3.4 KiB
Executable File

title layout permalink prevPage nextPage
Node Subclasses docs /docs/node-overview.html containers-overview.html subclassing.html

Texture offers the following nodes.

A key advantage of using nodes over UIKit components is that all nodes perform layout and display off of the main thread, so that the main thread is available to immediately respond to user interaction events.

Texture Node UIKit Equivalent
ASDisplayNode in place of UIKit's UIView
The root Texture node, from which all other nodes inherit.
ASCellNode in place of UIKit's UITableViewCell & UICollectionViewCell
ASCellNodes are used in ASTableNode, ASCollectionNode and ASPagerNode.
ASScrollNode in place of UIKit's UIScrollView

This node is useful for creating a customized scrollable region that contains other nodes.

ASEditableTextNode
ASTextNode
in place of UIKit's UITextView
in place of UIKit's UILabel
ASImageNode
ASNetworkImageNode
ASMultiplexImageNode
in place of UIKit's UIImageView
ASVideoNode
ASVideoPlayerNode
in place of UIKit's AVPlayerLayer
in place of UIKit's UIMoviePlayer
ASControlNode in place of UIKit's UIControl
ASButtonNode in place of UIKit's UIButton
ASMapNode in place of UIKit's MKMapView

Despite having rough equivalencies to UIKit components, in general, Texture nodes offer more advanced features and conveniences. For example, an `ASNetworkImageNode` does automatic loading and cache management, and even supports progressive jpeg and animated gifs.

The AsyncDisplayKitOverview example app gives basic implementations of each of the nodes listed above.

Node Inheritance Hierarchy

All Texture nodes inherit from ASDisplayNode.

node inheritance flowchart

The nodes highlighted in blue are synchronous wrappers of UIKit elements. For example, ASScrollNode wraps a UIScrollView, and ASCollectionNode wraps a UICollectionView. An ASMapNode in liveMapMode is a synchronous wrapper of UIMapView.