Mail style delete button on table view

Discussion in 'iPhone/iPad Programming' started by luckylefty01, Jul 24, 2008.

  1. macrumors member

    Joined:
    Apr 8, 2008
    #1
    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.
     
  2. macrumors 68040

    Joined:
    Apr 22, 2005
    #2
    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.
     
  3. macrumors newbie

    Joined:
    Jul 26, 2008
    #3
    Code

    Try adding this code into your UITableViewController class:

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

    ...
    }
     

Share This Page