-[UIView addSubnode:], -[CALayer addSubnode:].

Bring back this convenience API -- it disappeared somewhere along the
line while we were building Paper.  This is totally trivial, but
conveniently won't break if you layer-back a leaf node.

Closes #278.
This commit is contained in:
Nadine Salter
2015-02-02 19:53:36 -08:00
parent c6a04ef8bd
commit f085f06ff3
5 changed files with 43 additions and 4 deletions

View File

@@ -520,3 +520,19 @@ typedef CALayer *(^ASDisplayNodeLayerBlock)();
*/
@interface ASDisplayNode (ASDisplayNodeAsyncTransactionContainer) <ASDisplayNodeAsyncTransactionContainer>
@end
@interface UIView (AsyncDisplayKit)
/**
* Convenience method, equivalent to [view addSubview:node.view] or [view.layer addSublayer:node.layer] if layer-backed.
*/
- (void)addSubnode:(ASDisplayNode *)node;
@end
@interface CALayer (AsyncDisplayKit)
/**
* Convenience method, equivalent to [layer addSublayer:node.layer].
*/
- (void)addSubnode:(ASDisplayNode *)node;
@end