[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

25
Source/ASTableNode+Beta.h Normal file
View File

@@ -0,0 +1,25 @@
//
// ASTableNode+Beta.h
// Texture
//
// Copyright (c) 2017-present, Pinterest, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
#import <AsyncDisplayKit/ASTableNode.h>
@protocol ASBatchFetchingDelegate;
NS_ASSUME_NONNULL_BEGIN
@interface ASTableNode (Beta)
@property (nonatomic, weak) id<ASBatchFetchingDelegate> batchFetchingDelegate;
@end
NS_ASSUME_NONNULL_END