Update manual display logic

Postpone manual display until a future release when it can be called on any thread. Provide the current node manual display logic as a category on ASDisplayNode only available for ASRangeController. Deprecate -displayImmediately.
This commit is contained in:
Ryan Nystrom
2014-12-04 10:12:52 -08:00
parent db085c49be
commit 36cbea4f8f
4 changed files with 42 additions and 45 deletions

View File

@@ -434,33 +434,6 @@ void ASDisplayNodePerformBlockOnMainThread(void (^block)())
_contentsScaleForDisplay = contentsScaleForDisplay;
}
- (void)display
{
ASDisplayNodeAssertMainThread();
ASDisplayNodeAssert(self.nodeLoaded, @"backing store must be loaded before calling -display");
// rendering a backing store requires a node be laid out
[self __layout];
CALayer *layer = [self isLayerBacked] ? self.layer : self.view.layer;
if (layer.contents) {
return;
}
[layer setNeedsDisplay];
[layer displayIfNeeded];
}
- (void)recursivelyDisplay
{
for (ASDisplayNode *node in self.subnodes) {
[node recursivelyDisplay];
}
[self display];
}
- (void)displayImmediately
{
ASDisplayNodeAssertMainThread();