Search code examples
iosuitableviewcocoa-touchvoiceoveruiaccessibility

UIAccessibility to delete UITableViewCells


As of ios6, in native apps like mail and message, if voice over is turned on, and you tap on one of the table view cells(i.e. a email), and you turn your two fingers to bring up the rotor, then one of the options that can be selected is 'actions' which allows you to delete that table view cell.

I am wondering if anyone knows how to do this in the SDK? Im trying to implement the same thing. I know it's possible as dropbox has implemented the feature but after hours of searching I couldn't seem to find anything about how to do this.

Thanks.


Solution

  • After a day of frustration and viewing blogs and trial and error, I finally found the simple solution:

    Implement this method for your tableview's delegate:

    -(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:    (NSIndexPath *)indexPath{
    
        return UITableViewCellEditingStyleDelete;
    }
    

    And everything will magically fall into place!