How to hide reordering control in UITableViewCell without using reload?

In my application, when a user touches a table cell, the cell is disabled and the cell reordering control disappears. If they touch it again, the cell is activated and reordering control appears again. The way I'm currently implementing this is to call reloadRowsAtIndexPaths: withRowAnimation :, but this is sloooowww. If I just changed the showReorderControl property, nothing will happen. I had some success using setEditing: animated :, but it did not work sequentially. Any ideas? Thanks!

+4
source share
2 answers

Ok, I found a solution. I needed to use -tableView: canEditRowAtIndexPath: in addition to -tableView: canMoveRowAtIndexPath: and then when it came time to show or hide the reordering control, I used showReorderControl and setEditing: animated: to make it all work.

+10
source

The reorder control should only be displayed if the table is in edit mode. To show it for a specific row, you need to implement -tableView: canMoveRowAtIndexPath: in your tableView data source. There should be no reason to call -reloadData to show this control.

0
source

All Articles