Allow swipe-to-delete in one instance of UITableViewDataSource, but not another

Posted by synic on Stack Overflow See other posts from Stack Overflow or by synic
Published on 2010-05-21T16:39:31Z Indexed on 2010/05/21 16:50 UTC
Read the original article Hit count: 345

Filed under:

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.

© Stack Overflow or respective owner

Related posts about iphone