2

Can any help me.. is it possible to change the default swipe delete button frame and color.. i am new to iPhone...

    if ([NSStringFromClass([subview class])isEqualToString:@"UITableViewCellDeleteConfirmationControl"]) 
    {

        UIView *deleteButtonView = (UIView *)[subview.subviews objectAtIndex:0];
        CGRect f = deleteButtonView.frame;
        deleteButtonView.frame = f;
    }

i am using this piece of code but not working...

  • This question is already asked in SO before, http://stackoverflow.com/questions/2104403/iphone-uitableview-delete-button – Dhruv Aug 07 '12 at 06:35

1 Answers1

1

I don't think this is possible. You would have to implement your own "swipe to delete" button. Create a swipe gesture recognizer on your table view, set yourself as delegate, and detect swipes. Once a swipe was detected, determine the cell, add a UIButton (you'll have to create this from scratch, so you'd need your own images. Use UIKit Artwork Extractor to take the one Apple uses) and set its frame. You can maybe animate this, too.

Not the answer you want to hear, I'm sure, but I don't think there's a way around it. (Also, ask yourself if it's really necessary: Apple considers consistency very user friendly, so you may want to consider not deviating from that.)

Scott Berrevoets
  • 16,921
  • 6
  • 59
  • 80