mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
[Batch Fetching] Add ASBatchFetchingDelegate (#281)
* Add ASBatchFetchingDelegate - In addition to checking remaining leading screens, ASBatchFetching now also calculates a remaining time and consults its delegate if needed. - The delegate can override the decision of ASBatchFetching, for example based on remaining time and average time of past batch requests. * Fix up tests * Update CHANGELOG
This commit is contained in:
@@ -111,6 +111,7 @@
|
||||
{
|
||||
ASDN::RecursiveMutex _environmentStateLock;
|
||||
Class _collectionViewClass;
|
||||
id<ASBatchFetchingDelegate> _batchFetchingDelegate;
|
||||
}
|
||||
@property (nonatomic) _ASCollectionPendingState *pendingState;
|
||||
@end
|
||||
@@ -442,6 +443,16 @@
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)setBatchFetchingDelegate:(id<ASBatchFetchingDelegate>)batchFetchingDelegate
|
||||
{
|
||||
_batchFetchingDelegate = batchFetchingDelegate;
|
||||
}
|
||||
|
||||
- (id<ASBatchFetchingDelegate>)batchFetchingDelegate
|
||||
{
|
||||
return _batchFetchingDelegate;
|
||||
}
|
||||
|
||||
#pragma mark - Range Tuning
|
||||
|
||||
- (ASRangeTuningParameters)tuningParametersForRangeType:(ASLayoutRangeType)rangeType
|
||||
|
||||
Reference in New Issue
Block a user