Manually display nodes

Added a sample project that will demonstrate how to manually display nodes. Removed the UIWindow hack that coupled display of nodes with Core Animation transactions.
This commit is contained in:
Ryan Nystrom
2014-11-25 13:33:40 -08:00
parent ab46377af2
commit 8b0dbf7288
32 changed files with 1240 additions and 24 deletions

View File

@@ -437,6 +437,27 @@ void ASDisplayNodePerformBlockOnMainThread(void (^block)())
_contentsScaleForDisplay = contentsScaleForDisplay;
}
- (void)display
{
ASDisplayNodeAssertMainThread();
// rendering a backing store requires a node be laid out
[self layout];
for (ASDisplayNode *node in self.subnodes) {
[node display];
}
CALayer *layer = [self isLayerBacked] ? self.layer : self.view.layer;
if (layer.contents) {
return;
}
[layer setNeedsDisplay];
[layer displayIfNeeded];
}
- (void)displayImmediately
{
ASDisplayNodeAssertMainThread();