views:

676

answers:

1

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.

+1  A: 

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;
gerry3
By the way — these is a third option called "multi-select" with editingStyle = 3. This is an **undocumented** feature.
KennyTM
I guess I'll have to resize the cell's subviews myself then.
Marco Mustapic
Gah, that undocumented option would be perfect for us. Search on the iOS dev forums for uitableview with multi row selection for the official answer on this: don't use. Grrr.
MrCranky