mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 22:25:57 +00:00
ASDataController now handles reloadData more efficiently and notify its delegate once instead of a series of deletes and inserts
This commit is contained in:
@@ -276,4 +276,17 @@
|
||||
});
|
||||
}
|
||||
|
||||
- (void)dataControllerDidReloadData:(ASDataController *)dataController
|
||||
{
|
||||
ASPerformBlockOnMainThread(^{
|
||||
_rangeIsValid = NO;
|
||||
|
||||
// When reload data we need to make sure that _rangeTypeIndexPaths is cleared as well,
|
||||
// otherwise _updateVisibleNodeIndexPaths may try to retrieve nodes from dataSource that aren't there anymore
|
||||
[_rangeTypeIndexPaths removeAllObjects];
|
||||
|
||||
[_delegate rangeControllerDidReloadData:self];
|
||||
});
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user