mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Schedule _checkForBatchFetching call in animation block
This commit is contained in:
@@ -897,9 +897,9 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOL preventAnimation = animationOptions == UITableViewRowAnimationNone;
|
BOOL preventAnimation = animationOptions == UITableViewRowAnimationNone;
|
||||||
ASPerformBlockWithoutAnimationCompletion(preventAnimation, ^{
|
|
||||||
|
ASPerformBlockWithoutAnimation(preventAnimation, ^{
|
||||||
[super insertRowsAtIndexPaths:indexPaths withRowAnimation:(UITableViewRowAnimation)animationOptions];
|
[super insertRowsAtIndexPaths:indexPaths withRowAnimation:(UITableViewRowAnimation)animationOptions];
|
||||||
}, ^{
|
|
||||||
// Push this to the next runloop to be sure the UITableView has the right content size
|
// Push this to the next runloop to be sure the UITableView has the right content size
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[self _checkForBatchFetching];
|
[self _checkForBatchFetching];
|
||||||
@@ -921,9 +921,8 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
|||||||
}
|
}
|
||||||
|
|
||||||
BOOL preventAnimation = animationOptions == UITableViewRowAnimationNone;
|
BOOL preventAnimation = animationOptions == UITableViewRowAnimationNone;
|
||||||
ASPerformBlockWithoutAnimationCompletion(preventAnimation, ^{
|
ASPerformBlockWithoutAnimation(preventAnimation, ^{
|
||||||
[super deleteRowsAtIndexPaths:indexPaths withRowAnimation:(UITableViewRowAnimation)animationOptions];
|
[super deleteRowsAtIndexPaths:indexPaths withRowAnimation:(UITableViewRowAnimation)animationOptions];
|
||||||
}, ^{
|
|
||||||
// Push this to the next runloop to be sure the UITableView has the right content size
|
// Push this to the next runloop to be sure the UITableView has the right content size
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
[self _checkForBatchFetching];
|
[self _checkForBatchFetching];
|
||||||
@@ -948,6 +947,10 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
|||||||
BOOL preventAnimation = animationOptions == UITableViewRowAnimationNone;
|
BOOL preventAnimation = animationOptions == UITableViewRowAnimationNone;
|
||||||
ASPerformBlockWithoutAnimation(preventAnimation, ^{
|
ASPerformBlockWithoutAnimation(preventAnimation, ^{
|
||||||
[super insertSections:indexSet withRowAnimation:(UITableViewRowAnimation)animationOptions];
|
[super insertSections:indexSet withRowAnimation:(UITableViewRowAnimation)animationOptions];
|
||||||
|
// Push this to the next runloop to be sure the UITableView has the right content size
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[self _checkForBatchFetching];
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -963,6 +966,10 @@ static NSString * const kCellReuseIdentifier = @"_ASTableViewCell";
|
|||||||
BOOL preventAnimation = animationOptions == UITableViewRowAnimationNone;
|
BOOL preventAnimation = animationOptions == UITableViewRowAnimationNone;
|
||||||
ASPerformBlockWithoutAnimation(preventAnimation, ^{
|
ASPerformBlockWithoutAnimation(preventAnimation, ^{
|
||||||
[super deleteSections:indexSet withRowAnimation:(UITableViewRowAnimation)animationOptions];
|
[super deleteSections:indexSet withRowAnimation:(UITableViewRowAnimation)animationOptions];
|
||||||
|
// Push this to the next runloop to be sure the UITableView has the right content size
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[self _checkForBatchFetching];
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user