mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-16 03:09:56 +00:00
parent
10adca52d0
commit
5e7755fac0
@ -331,10 +331,19 @@ typedef CALayer *(^ASDisplayNodeLayerBlock)();
|
||||
* This method is used to notify the node that it should purge any content that is both expensive to fetch and to
|
||||
* retain in memory.
|
||||
*
|
||||
* @see fetchRemoteData
|
||||
* @see clearRemoteData and fetchRemoteData
|
||||
*/
|
||||
- (void)recursivelyClearRemoteData;
|
||||
|
||||
/**
|
||||
* @abstract Calls -fetchRemoteData on the receiver and its subnode hierarchy.
|
||||
*
|
||||
* @discussion Fetches content from remote sources for the current node and all subnodes.
|
||||
*
|
||||
* @see fetchRemoteData and clearRemoteData
|
||||
*/
|
||||
- (void)recursivelyFetchRemoteData;
|
||||
|
||||
/**
|
||||
* @abstract Toggle displaying a placeholder over the node that covers content until the node and all subnodes are
|
||||
* displayed.
|
||||
|
||||
@ -1348,6 +1348,14 @@ static NSInteger incrementIfFound(NSInteger i) {
|
||||
// subclass override
|
||||
}
|
||||
|
||||
- (void)recursivelyFetchRemoteData
|
||||
{
|
||||
for (ASDisplayNode *subnode in self.subnodes) {
|
||||
[subnode recursivelyFetchRemoteData];
|
||||
}
|
||||
[self fetchRemoteData];
|
||||
}
|
||||
|
||||
- (void)clearRemoteData
|
||||
{
|
||||
// subclass override
|
||||
|
||||
@ -16,13 +16,13 @@
|
||||
- (void)node:(ASDisplayNode *)node enteredRangeOfType:(ASLayoutRangeType)rangeType
|
||||
{
|
||||
ASDisplayNodeAssert(rangeType == ASLayoutRangeTypePreload, @"Preload delegate should not handle other ranges");
|
||||
[node fetchRemoteData];
|
||||
[node recursivelyFetchRemoteData];
|
||||
}
|
||||
|
||||
- (void)node:(ASDisplayNode *)node exitedRangeOfType:(ASLayoutRangeType)rangeType
|
||||
{
|
||||
ASDisplayNodeAssert(rangeType == ASLayoutRangeTypePreload, @"Preload delegate should not handle other ranges");
|
||||
[node clearRemoteData];
|
||||
[node recursivelyClearRemoteData];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user