Instance Method

willTransition(to:)

Called to notify the cell that it is about to transition to a new cell state.

Declaration

func willTransition(to state: UITableViewCell.StateMask)

Parameters

state

A bit mask indicating the state or combination of states the cell is transitioning to.

Discussion

Subclasses of UITableViewCell can implement this method to animate additional changes to a cell when it is changing state. UITableViewCell calls this method whenever a cell transitions between states, such as from a normal state (the default) to editing mode. The custom cell can set up and position any new views that appear with the new state. The cell then receives a layoutSubviews() message (UIView) in which it can position these new views in their final locations for the new state. Subclasses must always call super when overriding this method.

Note that when the user swipes a cell to delete it, the cell transitions to the state identified by the showingDeleteConfirmation constant but the showingEditControl is not set.

See Also

Adjusting to State Transitions

func didTransition(to: UITableViewCell.StateMask)

Called to notify the cell that it transitioned to a new cell state.

struct UITableViewCell.StateMask

Constants used to determine the new state of a cell as it transitions between states.