diff --git a/AsyncDisplayKit/ASCollectionView.h b/AsyncDisplayKit/ASCollectionView.h index e6f43bec3c..e508e18b24 100644 --- a/AsyncDisplayKit/ASCollectionView.h +++ b/AsyncDisplayKit/ASCollectionView.h @@ -164,6 +164,12 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)reloadDataImmediately; +/** + * Triggers a relayout of all nodes. + * + */ +- (void)relayoutItems; + /** * Blocks execution of the main thread until all section and row updates are committed. This method must be called from the main thread. */ diff --git a/AsyncDisplayKit/ASCollectionView.mm b/AsyncDisplayKit/ASCollectionView.mm index c379f3cbce..ffb3854014 100644 --- a/AsyncDisplayKit/ASCollectionView.mm +++ b/AsyncDisplayKit/ASCollectionView.mm @@ -313,6 +313,11 @@ - (void)reloadDataImmediately [super reloadData]; } +- (void)relayoutItems +{ + [_dataController relayoutAllNodes]; +} + - (void)waitUntilAllUpdatesAreCommitted { ASDisplayNodeAssertMainThread(); diff --git a/AsyncDisplayKit/ASTableView.h b/AsyncDisplayKit/ASTableView.h index 1f336959e5..406d141cc0 100644 --- a/AsyncDisplayKit/ASTableView.h +++ b/AsyncDisplayKit/ASTableView.h @@ -134,6 +134,12 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)reloadDataImmediately; +/** + * Triggers a relayout of all nodes. + * + */ +- (void)relayoutItems; + /** * begins a batch of insert, delete reload and move operations. This method must be called from the main thread. */ diff --git a/AsyncDisplayKit/ASTableView.mm b/AsyncDisplayKit/ASTableView.mm index 0e4f705df2..52b99997f2 100644 --- a/AsyncDisplayKit/ASTableView.mm +++ b/AsyncDisplayKit/ASTableView.mm @@ -354,6 +354,11 @@ - (void)reloadDataImmediately [super reloadData]; } +- (void)relayoutItems +{ + [_dataController relayoutAllNodes]; +} + - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType { [_layoutController setTuningParameters:tuningParameters forRangeMode:ASLayoutRangeModeFull rangeType:rangeType];