expose relayoutAllNodes at ASCollectionView level (#1683)

* expose relayoutAllNodes at ASCollectionView level

* rename relayoutAllNodes to relayoutItems to be more UIKit centric
This commit is contained in:
Nick Velloff
2016-05-23 23:22:01 -07:00
committed by appleguy
parent 94bb3b79cb
commit d0c30a43ca
4 changed files with 22 additions and 0 deletions

View File

@@ -164,6 +164,12 @@ NS_ASSUME_NONNULL_BEGIN
*/ */
- (void)reloadDataImmediately; - (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. * Blocks execution of the main thread until all section and row updates are committed. This method must be called from the main thread.
*/ */

View File

@@ -313,6 +313,11 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
[super reloadData]; [super reloadData];
} }
- (void)relayoutItems
{
[_dataController relayoutAllNodes];
}
- (void)waitUntilAllUpdatesAreCommitted - (void)waitUntilAllUpdatesAreCommitted
{ {
ASDisplayNodeAssertMainThread(); ASDisplayNodeAssertMainThread();

View File

@@ -134,6 +134,12 @@ NS_ASSUME_NONNULL_BEGIN
*/ */
- (void)reloadDataImmediately; - (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. * begins a batch of insert, delete reload and move operations. This method must be called from the main thread.
*/ */

View File

@@ -354,6 +354,11 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
[super reloadData]; [super reloadData];
} }
- (void)relayoutItems
{
[_dataController relayoutAllNodes];
}
- (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType - (void)setTuningParameters:(ASRangeTuningParameters)tuningParameters forRangeType:(ASLayoutRangeType)rangeType
{ {
[_layoutController setTuningParameters:tuningParameters forRangeMode:ASLayoutRangeModeFull rangeType:rangeType]; [_layoutController setTuningParameters:tuningParameters forRangeMode:ASLayoutRangeModeFull rangeType:rangeType];