How to set a custom edit-style icon in a UITableViewCell while in edit mode

Marco Mustapic picture Marco Mustapic · Jan 14, 2010 · Viewed 12k times · Source

Is there any way to have a custom edit-style icon (besides the green plus and red minus icons) when enabling edit-mode in a UITableView?

I know I could simulate the the edit-mode animation and just move the cell contents to the right and add a UIImageView, but I was trying to avoid that.

Answer

gerry3 picture gerry3 · Jan 14, 2010

The only way to customize the editing style of a cell is using tableView:editingStyleForRowAtIndexPath: which must return a UITableViewCellEditingStyle.

None, delete (red minus), and insert (green plus) are the only options. From the documentation:

Cell Editing Style

The editing control used by a cell.

typedef enum {   
UITableViewCellEditingStyleNone,   
UITableViewCellEditingStyleDelete,   
UITableViewCellEditingStyleInsert  
} UITableViewCellEditingStyle;