Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.

Commit 2bb7fc4

Browse files
committed
Add reloadData forward methods to ASCollectionNode
1 parent 63b493a commit 2bb7fc4

4 files changed

Lines changed: 41 additions & 7 deletions

File tree

AsyncDisplayKit/ASCollectionNode.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,28 @@
1818

1919
@property (nonatomic, readonly) ASCollectionView *view;
2020

21+
/**
22+
* Reload everything from scratch, destroying the working range and all cached nodes.
23+
*
24+
* @param completion block to run on completion of asynchronous loading or nil. If supplied, the block is run on
25+
* the main thread.
26+
* @warning This method is substantially more expensive than UICollectionView's version.
27+
*/
28+
- (void)reloadDataWithCompletion:(void (^)())completion;
29+
30+
/**
31+
* Reload everything from scratch, destroying the working range and all cached nodes.
32+
*
33+
* @warning This method is substantially more expensive than UICollectionView's version.
34+
*/
35+
- (void)reloadData;
36+
37+
/**
38+
* Reload everything from scratch entirely on the main thread, destroying the working range and all cached nodes.
39+
*
40+
* @warning This method is substantially more expensive than UICollectionView's version and will block the main thread
41+
* while all the cells load.
42+
*/
43+
- (void)reloadDataImmediately;
44+
2145
@end

AsyncDisplayKit/ASCollectionNode.m

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,21 @@ - (void)clearFetchedData
4343
[self.view clearFetchedData];
4444
}
4545

46+
#pragma mark - ASCollectionView Forwards
47+
48+
- (void)reloadDataWithCompletion:(void (^)())completion
49+
{
50+
[self.view reloadDataWithCompletion:completion];
51+
}
52+
53+
- (void)reloadData
54+
{
55+
[self.view reloadData];
56+
}
57+
58+
- (void)reloadDataImmediately
59+
{
60+
[self.view reloadDataImmediately];
61+
}
62+
4663
@end

AsyncDisplayKit/ASPagerNode.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414

1515
@property (weak, nonatomic) id<ASPagerNodeDataSource> dataSource;
1616

17-
- (void)reloadData;
18-
1917
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType;
2018

2119
@end

AsyncDisplayKit/ASPagerNode.m

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,6 @@ - (void)didLoad
4949
[self setTuningParameters:renderParams forRangeType:ASLayoutRangeTypeRender];
5050
}
5151

52-
- (void)reloadData
53-
{
54-
[self.view reloadData];
55-
}
56-
5752
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType
5853
{
5954
[self.view setTuningParameters:tuningParameters forRangeType:rangeType];

0 commit comments

Comments
 (0)