mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Add batch animation
This commit is contained in:
@@ -213,7 +213,7 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
|
||||
- (void)beginUpdates
|
||||
{
|
||||
[self throwUnimplementedException];
|
||||
[_dataController beginUpdates];
|
||||
}
|
||||
|
||||
- (void)endUpdates
|
||||
@@ -223,17 +223,17 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
|
||||
- (void)insertSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation
|
||||
{
|
||||
[_dataController insertSections:sections];
|
||||
[_dataController insertSections:sections withAnimationOption:animation];
|
||||
}
|
||||
|
||||
- (void)deleteSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation
|
||||
{
|
||||
[_dataController deleteSections:sections];
|
||||
[_dataController deleteSections:sections withAnimationOption:animation];
|
||||
}
|
||||
|
||||
- (void)reloadSections:(NSIndexSet *)sections withRowAnimation:(UITableViewRowAnimation)animation
|
||||
{
|
||||
[_dataController reloadSections:sections];
|
||||
[_dataController reloadSections:sections withAnimationOption:animation];
|
||||
}
|
||||
|
||||
- (void)moveSection:(NSInteger)section toSection:(NSInteger)newSection
|
||||
@@ -243,17 +243,17 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
|
||||
- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
|
||||
{
|
||||
[_dataController insertRowsAtIndexPaths:indexPaths];
|
||||
[_dataController insertRowsAtIndexPaths:indexPaths withAnimationOption:animation];
|
||||
}
|
||||
|
||||
- (void)deleteRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
|
||||
{
|
||||
[_dataController deleteRowsAtIndexPaths:indexPaths];
|
||||
[_dataController deleteRowsAtIndexPaths:indexPaths withAnimationOption:animation];
|
||||
}
|
||||
|
||||
- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
|
||||
{
|
||||
[_dataController reloadRowsAtIndexPaths:indexPaths];
|
||||
[_dataController reloadRowsAtIndexPaths:indexPaths withAnimationOption:animation];
|
||||
}
|
||||
|
||||
- (void)moveRowAtIndexPath:(NSIndexPath *)indexPath toIndexPath:(NSIndexPath *)newIndexPath
|
||||
@@ -341,6 +341,16 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
#pragma mark -
|
||||
#pragma mark ASRangeControllerDelegate.
|
||||
|
||||
- (void)rangeControllerBeginUpdates:(ASRangeController *)rangeController {
|
||||
ASDisplayNodeAssertMainThread();
|
||||
[super beginUpdates];
|
||||
}
|
||||
|
||||
- (void)rangeControllerEndUpdates:(ASRangeController *)rangeController {
|
||||
ASDisplayNodeAssertMainThread();
|
||||
[super endUpdates];
|
||||
}
|
||||
|
||||
- (NSArray *)rangeControllerVisibleNodeIndexPaths:(ASRangeController *)rangeController
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
@@ -358,40 +368,40 @@ static BOOL _isInterceptedSelector(SEL sel)
|
||||
return self.bounds.size;
|
||||
}
|
||||
|
||||
- (void)rangeController:(ASRangeController *)rangeController didInsertNodesAtIndexPaths:(NSArray *)indexPaths
|
||||
- (void)rangeController:(ASRangeController *)rangeController didInsertNodesAtIndexPaths:(NSArray *)indexPaths withAnimationOption:(ASDataControllerAnimationOptions)animationOption
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
[UIView performWithoutAnimation:^{
|
||||
[super insertRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
|
||||
}];
|
||||
// [UIView performWithoutAnimation:^{
|
||||
[super insertRowsAtIndexPaths:indexPaths withRowAnimation:(UITableViewRowAnimation)animationOption];
|
||||
// }];
|
||||
}
|
||||
|
||||
- (void)rangeController:(ASRangeController *)rangeController didDeleteNodesAtIndexPaths:(NSArray *)indexPaths
|
||||
- (void)rangeController:(ASRangeController *)rangeController didDeleteNodesAtIndexPaths:(NSArray *)indexPaths withAnimationOption:(ASDataControllerAnimationOptions)animationOption
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
[UIView performWithoutAnimation:^{
|
||||
[super deleteRowsAtIndexPaths:indexPaths withRowAnimation:UITableViewRowAnimationNone];
|
||||
}];
|
||||
// [UIView performWithoutAnimation:^{
|
||||
[super deleteRowsAtIndexPaths:indexPaths withRowAnimation:(UITableViewRowAnimation)animationOption];
|
||||
// }];
|
||||
}
|
||||
|
||||
- (void)rangeController:(ASRangeController *)rangeController didInsertSectionsAtIndexSet:(NSIndexSet *)indexSet
|
||||
- (void)rangeController:(ASRangeController *)rangeController didInsertSectionsAtIndexSet:(NSIndexSet *)indexSet withAnimationOption:(ASDataControllerAnimationOptions)animationOption
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
[UIView performWithoutAnimation:^{
|
||||
[super insertSections:indexSet withRowAnimation:UITableViewRowAnimationNone];
|
||||
}];
|
||||
// [UIView performWithoutAnimation:^{
|
||||
[super insertSections:indexSet withRowAnimation:(UITableViewRowAnimation)animationOption];
|
||||
// }];
|
||||
}
|
||||
|
||||
- (void)rangeController:(ASRangeController *)rangeController didDeleteSectionsAtIndexSet:(NSIndexSet *)indexSet
|
||||
- (void)rangeController:(ASRangeController *)rangeController didDeleteSectionsAtIndexSet:(NSIndexSet *)indexSet withAnimationOption:(ASDataControllerAnimationOptions)animationOption
|
||||
{
|
||||
ASDisplayNodeAssertMainThread();
|
||||
|
||||
[UIView performWithoutAnimation:^{
|
||||
[super deleteSections:indexSet withRowAnimation:UITableViewRowAnimationNone];
|
||||
}];
|
||||
// [UIView performWithoutAnimation:^{
|
||||
[super deleteSections:indexSet withRowAnimation:(UITableViewRowAnimation)animationOption];
|
||||
// }];
|
||||
}
|
||||
|
||||
#pragma mark - ASDataControllerDelegate
|
||||
|
||||
Reference in New Issue
Block a user