mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
2611 rename fetch data (#2689)
* Replace fetch data with preload terminology - Deprecate `-fetchData` and `-clearFetchedData` in favor of `-preload` and `-clearPreloadedData` - Move `-setNeedsPreload`, `-recursivelyPreload` and `-recursivelyClearPreloadedData` to ASDisplayNode+FrameworkPrivate.h - Update internal implementation, comments and tests * Folllow up on #2642: - Remove -preload and -clearPreloadedData in favor of -didEnterPreloadState and -didExitPreloadState. - -didEnterPreloadState and -didExitPreloadState call the deprecated -fetchData and -clearFetchedData methods if they are overriden. * Missed one in a test * Get rid of behavior change for now. * Revert more behavior changes, fix tests. * Don't need these anymore.
This commit is contained in:
committed by
Hannah Troisi
parent
c7ea15a5e4
commit
ba2268ac99
@@ -216,12 +216,12 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
|
||||
[super clearContents]; // This actually clears the contents, so we need to do this first for our displayedImageIdentifier to be meaningful.
|
||||
[self _setDisplayedImageIdentifier:nil withImage:nil];
|
||||
|
||||
// NOTE: We intentionally do not cancel image downloads until `clearFetchedData`.
|
||||
// NOTE: We intentionally do not cancel image downloads until `clearPreloadedData`.
|
||||
}
|
||||
|
||||
- (void)clearFetchedData
|
||||
- (void)didExitPreloadState
|
||||
{
|
||||
[super clearFetchedData];
|
||||
[super didExitPreloadState];
|
||||
|
||||
[_phImageRequestOperation cancel];
|
||||
|
||||
@@ -236,9 +236,9 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
|
||||
self.image = nil;
|
||||
}
|
||||
|
||||
- (void)fetchData
|
||||
- (void)didEnterPreloadState
|
||||
{
|
||||
[super fetchData];
|
||||
[super didEnterPreloadState];
|
||||
|
||||
[self _loadImageIdentifiers];
|
||||
}
|
||||
@@ -281,7 +281,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
|
||||
{
|
||||
[super displayWillStart];
|
||||
|
||||
[self fetchData];
|
||||
[self didEnterPreloadState];
|
||||
|
||||
if (_downloaderImplementsSetPriority) {
|
||||
{
|
||||
@@ -396,7 +396,7 @@ typedef void(^ASMultiplexImageLoadCompletionBlock)(UIImage *image, id imageIdent
|
||||
_imageIdentifiers = [[NSArray alloc] initWithArray:imageIdentifiers copyItems:YES];
|
||||
}
|
||||
|
||||
[self setNeedsDataFetch];
|
||||
[self setNeedsPreload];
|
||||
}
|
||||
|
||||
- (void)reloadImageIdentifierSources
|
||||
|
||||
Reference in New Issue
Block a user