PDA

View Full Version : Mail style delete button on table view




luckylefty01
Jul 24, 2008, 10:23 PM
I'd really like to figure out how to get a mail style* delete button to show up in my app when I set my table view to editing. Is there any way to do this? I'm not having any luck finding any info on it.

My eventual goal would be to replace the "delete" text with different text for a similar action, but I really need the button with the text as opposed to the little delete sign.

*as in you swipe and a little red box pops up on the right with the text "Delete" on it.



admanimal
Jul 26, 2008, 06:21 PM
*as in you swipe and a little red box pops up on the right with the text "Delete" on it.

This is the default behavior for table rows. As far as I know, I didn't do anything special to my table to enable it, but this is exactly what it does and I didn't have to implement it myself.

robfarmer
Jul 26, 2008, 07:42 PM
Try adding this code into your UITableViewController class:

- (void)viewDidLoad {
self.navigationItem.rightBarButtonItem = self.editButtonItem;

...
}