mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
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:
@@ -268,6 +268,12 @@ static NSString * const kCellReuseIdentifier = @"_ASCollectionViewCell";
|
||||
[super reloadData];
|
||||
}
|
||||
|
||||
- (void)waitUntilAllUpdatesAreCommitted
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
[_dataController waitUntilAllUpdatesAreCommitted];
|
||||
}
|
||||
|
||||
- (void)setDataSource:(id<UICollectionViewDataSource>)dataSource
|
||||
{
|
||||
// UIKit can internally generate a call to this method upon changing the asyncDataSource; only assert for non-nil.
|
||||
|
||||
Reference in New Issue
Block a user