Luca
Luca

Reputation: 1874

Intercept tap on Deletion control in UITableView

I want to intercept taps on the circular Deletion control (example of Deletion Control button) on my TableView to know when the "Delete" button comes in and I can change my cell layout. Can Anyone help me? thanks a lot!

Upvotes: 1

Views: 765

Answers (1)

Vladimir
Vladimir

Reputation: 170849

You can handle "Delete" button appearance if you subclass UITableViewCell and override -willTransitionToState and/or -didTransitionToState methods there. Like:

- (void)willTransitionToState:(UITableViewCellStateMask)state{
    if (state & UITableViewCellStateShowingDeleteConfirmationMask)
       // Delete button will appear
}

Upvotes: 3

Related Questions