[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:
Huy Nguyen
2017-05-17 13:26:30 +01:00
committed by GitHub
parent 432018cfdc
commit 8c45eaefce
12 changed files with 160 additions and 32 deletions

View File

@@ -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