Allow swipe-to-delete in one instance of UITableViewDataSource, but not another
- by synic
I've got a UITableViewDataSource that I'm using for two different UITableViews. In one of the table views, I want to enable swipe-to-delete, so I've implemented tableView:commitEditingStyle:forRowAtIndexPath, and it works as expected. However, in another table, I want to disable that feature.
I've got it working by making two UITableViewDataSource classes, one subclassing the other, and I only implement tableView:commitEditingStyle:forRowAtIndexPath in the subclass. I call them RecipientModel and RecipientModelEditable.
I'm wondering if there's a better way.