AsyncDisplayKit is now Texture! LEARN MORE

Texture

Layout Options

When using Texture, you have three options for layout. Note that UIKit Autolayout is not supported by Texture. #Manual Sizing & Layout

This original layout method shipped with Texture 1.0 and is analogous to UIKit’s layout methods. Use this method for ASDKViewControllers (unless you subclass the node).

[ASDisplayNode calculateSizeThatFits:] vs. [UIView sizeThatFits:]

[ASDisplayNode layout] vs. [UIView layoutSubviews]

###Advantages (over UIKit)

###Shortcomings (same as UIKit):

#Unified Sizing & Layout

This layout method does not have a UIKit analog. It is implemented by calling

- (ASLayout *)calculateLayoutThatFits: (ASSizeRange)constraint

###Advantages

###Shortcomings

Automatic, Extensible Layout

This is the reccomended layout method. It does not have a UIKit analog and is implemented by calling

- (ASLayoutSpec *)layoutSpecThatFits:(ASSizeRange)constraint ###Advantages

The diagram below shows how options #2 and #3 above both result in an ASLayout, except that in option #3, the ASLayout is produced automatically by the ASLayoutSpec.

Edit on GitHub