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

Commit

Permalink
expose relayoutAllNodes at ASCollectionView level (#1683)
Browse files Browse the repository at this point in the history
* expose relayoutAllNodes at ASCollectionView level

* rename relayoutAllNodes to relayoutItems to be more UIKit centric
  • Loading branch information
nickvelloff authored and appleguy committed May 24, 2016
1 parent 94bb3b7 commit d0c30a4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions AsyncDisplayKit/ASCollectionView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
5 changes: 5 additions & 0 deletions AsyncDisplayKit/ASCollectionView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,11 @@ - (void)reloadDataImmediately
[super reloadData];
}

- (void)relayoutItems
{
[_dataController relayoutAllNodes];
}

- (void)waitUntilAllUpdatesAreCommitted
{
ASDisplayNodeAssertMainThread();
Expand Down
6 changes: 6 additions & 0 deletions AsyncDisplayKit/ASTableView.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
5 changes: 5 additions & 0 deletions AsyncDisplayKit/ASTableView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit d0c30a4

Please sign in to comment.