Add reloadData forward methods to ASCollectionNode

This commit is contained in:
Levi McCallum
2015-12-21 08:58:55 -06:00
parent 63b493a95b
commit 2bb7fc43f5
4 changed files with 41 additions and 7 deletions

View File

@@ -18,4 +18,28 @@
@property (nonatomic, readonly) ASCollectionView *view;
/**
* Reload everything from scratch, destroying the working range and all cached nodes.
*
* @param completion block to run on completion of asynchronous loading or nil. If supplied, the block is run on
* the main thread.
* @warning This method is substantially more expensive than UICollectionView's version.
*/
- (void)reloadDataWithCompletion:(void (^)())completion;
/**
* Reload everything from scratch, destroying the working range and all cached nodes.
*
* @warning This method is substantially more expensive than UICollectionView's version.
*/
- (void)reloadData;
/**
* Reload everything from scratch entirely on the main thread, destroying the working range and all cached nodes.
*
* @warning This method is substantially more expensive than UICollectionView's version and will block the main thread
* while all the cells load.
*/
- (void)reloadDataImmediately;
@end

View File

@@ -43,4 +43,21 @@
[self.view clearFetchedData];
}
#pragma mark - ASCollectionView Forwards
- (void)reloadDataWithCompletion:(void (^)())completion
{
[self.view reloadDataWithCompletion:completion];
}
- (void)reloadData
{
[self.view reloadData];
}
- (void)reloadDataImmediately
{
[self.view reloadDataImmediately];
}
@end

View File

@@ -14,8 +14,6 @@
@property (weak, nonatomic) id<ASPagerNodeDataSource> dataSource;
- (void)reloadData;
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType;
@end

View File

@@ -49,11 +49,6 @@
[self setTuningParameters:renderParams forRangeType:ASLayoutRangeTypeRender];
}
- (void)reloadData
{
[self.view reloadData];
}
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType
{
[self.view setTuningParameters:tuningParameters forRangeType:rangeType];