UITalbeView need to delete row that might be reordering

No, my code is not crashing by just deleting content, or reordering content, that works fine.

The issue is, the content is connected to a pusher service and it might need to delete a row at any point, even while reordering. I have been looking around for some time and I haven't found a way to:

  • Cancel the reordering of the cell when delete is needed (it goes blank / clear).
  • Avoid any actions from a deleted cell when it finishes 'reordering'.
  • Tell if the table is reordering the cell before I need to delete it.

So in short I need to delete a cell that might be reordering from a UITableView.

Have you faced a similar issue?

1 answer

  • answered 2018-03-13 20:19 user2108564

    Anyways, I found a way to do it. Here's the logic just in case anyone ever needs it.

    1. Prevent the cell's movement with the use of tableView:targetIndexPathForMoveFromRowAt:
    2. On delete control don't call [yourTableView].deleteRows, call reloadData

    Looks like that's it. Thanks