mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 22:55:00 +00:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user