I am trying to set the type of animation for removing a cell from a table using deleteRowsAtIndexPaths withRowAnimation. The animation appears, but regardless of the type transferred, it is always the same. The cell shrinks up and disappears. The loadData method updates the array with data to fill the table.

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ [[_coreData managedObjectContext] deleteObject:[_notes objectAtIndex:indexPath.row]]; [_coreData saveData]; [self loadData]; [self.tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade]; } 
  • You may need to add beginUpdates and endUpdates. Never caused an animated table update outside of these methods. - Andrew Romanov
  • Tried - does not help. As far as I understood from the documentation, inside them you need to prescribe an animation that should go at the same time. - Grishechko Vladislav
  • Try to make a test project, without your business logic, if it doesn’t cope with it, add a link to it here. If correct, look for differences. - Andrew Romanov
  • Check if you are invoking another delegate method at the same time as the animation. For example, try deleting a cell first, then changing the model. - Vitali Eller
  • Made a naked project with a navigation controller. In general, if you delete cells through the regular Edit button in the navigation bar, i.e. red circles appear, by pressing the red Delete button to the right of the cell, the animation is always just as I described. And if you perform the removal in another way, for example, by calling the selector with a delay or by pressing the cell, then everything works as it should. I think the animation with the Delete button knocks the cell animation, or it is programmatically set that in this case only one type of animation. Is it possible to get around somehow? - Grishechko Vladislav

0