Your subclass of UITableViewCell implements the willTransitionToState: method. This method is called by UITableView when the cell goes to / from the editing state.
In your implementation of the class, you will need to conditionally check the value of the mask parameter passed to the method to determine what state the cell translates to / from. Possible values for the mask ...
enum {
UITableViewCellStateDefaultMask = 0,
UITableViewCellStateShowingEditControlMask = 1 << 0,
UITableViewCellStateShowingDeleteConfirmationMask = 1 << 1
};
In your case, you will need transition observations in the UITableViewCellStateDefaultMask, so your implementation will be as follows:
- (void)willTransitionToState:(UITableViewCellStateMask)state {
if (state == UITableViewCellStateDefaultMask) {
}
}
source
share