aherlambang
aherlambang

Reputation: 14418

positioning and customizing delete button for custom UITableViewCell

I have a subclassed UITableViewCell and now I also need a custom delete button for this cell. What should I do in this case? Do I add this button in the layoutSubView? I already have my delete button on the nib file of the cell.

What I have now in the custom cell is to show the button in the didTransitionToState:(UITableViewCellStateMask) state. This works, however it shows the delete button. I don't want it to show the delete button and instead I want the user to just press the button to delete the row. How can I do this?

Upvotes: 2

Views: 6391

Answers (1)

jrturton
jrturton

Reputation: 119242

You can link your custom delete button to the editing accessory view outlet of your cell.

You also need to stop the cell from going into "standard" delete mode, just set it to editing on swipe. There are some details in my related question here : UITableViewCell custom editingAccessoryView - not properly dismissed

And also my answer here : custom editingAccessoryView not working

Upvotes: 2

Related Questions