Skip to content

Commit

Permalink
fix(ios): listview and waterfall reload animation bug
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg committed Oct 16, 2023
1 parent 1739716 commit 70fc3ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,20 +210,19 @@ - (void)applyDiff:(NativeRenderBaseListViewDataSource *)another

BOOL success = YES;
if ([batchUpdate count]) {
[UIView setAnimationsEnabled:NO];
[CATransaction begin];
[CATransaction setDisableActions:YES];
@try {
[view performBatchUpdates:^{
for (NSInvocation *invocation in batchUpdate) {
[invocation invoke];
}
} completion:^(BOOL finished) {
[UIView setAnimationsEnabled:YES];
}];
} completion:nil];
} @catch (NSException *exception) {
[view reloadData];
success = NO;
[UIView setAnimationsEnabled:YES];
}
[CATransaction commit];
}
completion(success);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,20 +367,19 @@ - (void)applyDiff:(NativeRenderWaterfallViewDataSource *)another
}];
BOOL success = YES;
if ([batchUpdate count]) {
[UIView setAnimationsEnabled:NO];
[CATransaction begin];
[CATransaction setDisableActions:YES];
@try {
[view performBatchUpdates:^{
for (NSInvocation *invocation in batchUpdate) {
[invocation invoke];
}
} completion:^(BOOL finished) {
[UIView setAnimationsEnabled:YES];
}];
} completion:nil];
} @catch (NSException *exception) {
success = NO;
[view reloadData];
[UIView setAnimationsEnabled:YES];
success = NO;
}
[CATransaction commit];
}
completion(success);
}
Expand Down

0 comments on commit 70fc3ee

Please sign in to comment.