0

I have a table section with a bunch of custom cells, each of which has two UITextFields right next to each other.

When the table enters editing mode, I have to resize the right UITextField of each cell so that it doesn't get pushed off the screen by the delete minus sign that appears to the left of the cell.

I need to do a similar thing for when the user presses the delete minus sign and the "Delete"m button appears on the right side of the cell. I need to resize the right UITextField so that it isn't partially obscured by the Delete button. However, I can not find any protocol method or anything that alerts me when the delete button appears.

When the user swipes the row to delete, this method seems to work:

- (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath

However, when the user presses the red minus button to delete, it doesn't call that function.

Randall Schmidt
  • 93
  • 1
  • 12
  • 1
    does this work for you? http://stackoverflow.com/questions/2104403/iphone-uitableview-delete-button – danqing Aug 15 '12 at 22:30
  • Looks like it probably will. I will try that out tomorrow, thanks. – Randall Schmidt Aug 15 '12 at 22:45
  • @RandallSchmidt If you are using customTableviewCell implement the method suggested by Tieme, else you will have to subclass UITableviewCell and implement same method. – ViruMax Feb 26 '14 at 10:19

2 Answers2

0

Try using these:

 - (void)willTransitionToState:(UITableViewCellStateMask)newState{
    [super willTransitionToState:newState];

    //deletebutton (minusbutton) will be animated in
    if(newState == UITableViewCellStateShowingEditControlMask){

    }

    //deletebutton (minusbutton) will be animated out
    if(newState == UITableViewCellStateDefaultMask){

    }

    //deletebutton (minusbutton) will be rotated 90 degrees ccw
    if(newState == 3){

    }

    //deletebutton (minusbutton) will be rotated 90 degrees cw
    if(newState == UITableViewCellStateShowingEditControlMask){

    }
}
Tieme
  • 62,602
  • 20
  • 102
  • 156
0

cell.showingDeleteConfirmation is what you're looking for.

Anthony E
  • 31
  • 2