Fix the Initialization Hierarchy (#3207)

* Fix the initializers setup

* Update Swift example

* Remove incorrect comment

* Add one to ASTableNode
This commit is contained in:
Adlai Holler
2017-03-28 11:48:20 -07:00
committed by GitHub
parent 27c94069ae
commit fcbbea51a6
10 changed files with 84 additions and 88 deletions

View File

@@ -125,7 +125,7 @@ extern NSInteger const ASDefaultDrawingPriority;
* @return An ASDisplayNode instance whose view will be a subclass that enables asynchronous rendering, and passes
* through -layout and touch handling methods.
*/
- (instancetype)init;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
/**
@@ -183,6 +183,28 @@ extern NSInteger const ASDefaultDrawingPriority;
*/
- (void)onDidLoad:(ASDisplayNodeDidLoadBlock)body;
/**
* Set the block that should be used to load this node's view.
*
* @param viewBlock The block that creates a view for this node.
*
* @precondition The node is not yet loaded.
*
* @note You will usually NOT call this. See the limitations documented in @c initWithViewBlock:
*/
- (void)setViewBlock:(ASDisplayNodeViewBlock)viewBlock;
/**
* Set the block that should be used to load this node's layer.
*
* @param viewBlock The block that creates a layer for this node.
*
* @precondition The node is not yet loaded.
*
* @note You will usually NOT call this. See the limitations documented in @c initWithLayerBlock:
*/
- (void)setLayerBlock:(ASDisplayNodeLayerBlock)layerBlock;
/**
* @abstract Returns whether the node is synchronous.
*