Skip to content

Latest commit

 

History

History
executable file
·
81 lines (67 loc) · 3.42 KB

node-overview.md

File metadata and controls

executable file
·
81 lines (67 loc) · 3.42 KB
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 preform 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 UIImage
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.