Add -waitUntilAllUpdatesAreCommitted to ASTableView and ASCollectionView

The API allows consumer of ASTableView or ASCollectionCiew to block execution of the main thread until all section and row updates are committed.
This commit is contained in:
Michael Schneider
2016-03-02 19:20:58 -08:00
parent e82d1408d2
commit aa2ae87c81
6 changed files with 41 additions and 0 deletions

View File

@@ -394,6 +394,12 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
[_dataController endUpdatesAnimated:animated completion:completion];
}
- (void)waitUntilAllUpdatesAreCommitted
{
ASDisplayNodeAssertMainThread();
[_dataController waitUntilAllUpdatesAreCommitted];
}
- (void)layoutSubviews
{
if (_nodesConstrainedWidth != self.bounds.size.width) {