Contents

setEditing(_:animated:)

Toggles the cell into and out of editing mode.

Declaration

func setEditing(_ editing: Bool, animated: Bool)

Parameters

  • editing:

    True to enter editing mode, False to leave it. The default value is False.

  • animated:

    True to animate the appearance or disappearance of the insertion/deletion control and the reordering control, False to make the transition immediate.

Discussion

When you call this method with the value of editing set to true, and the UITableViewCell object is configured to have controls, the cell shows an insertion (green plus) or deletion control (red minus) on the left side of each cell and a reordering control on the right side. This method is called on each visible cell when the setEditing(_:animated:) method of UITableView is invoked. Calling this method with editing set to false removes the controls from the cell.

See Also

Editing the cell