tableView.beginUpdates is not working iOS10

Originator:ashraf.tawfeeq
Number:rdar://324324325 Date Originated:26/09/2016
Status:Open Resolved:
Product:iOS10.0 Product Version:
Classification:Critical Reproducible:100%
 
UITableView method begin updates on iOS10 does not animate UITableViewCell constraints. For example, if you want to animate the height of a specified cell with tableView.beginUpdates() and tableView.endUpdates() won't work. 

#pragma mark - Table view delegate
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return self.selectedIndexPath && self.selectedIndexPath.row == indexPath.row ? self.view.frame.size.height - self.navigationController.navigationBar.frame.size.height + 20 : UITableViewAutomaticDimension;
}
Inside the didSelect Method

if(shouldExpand){
        [UIView animateWithDuration:0.3 delay:0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
            [self.tableView beginUpdates];
            [self.tableView endUpdates];
        } completion:nil];
}
else{
    [self.tableView beginUpdates];
    [self.tableView endUpdates];
}

Comments

Try -[UITableView reloadRowsAtIndexPaths:withRowAnimation:]


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!