<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITableViewCell/setEditing(_:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITableViewCell(im)setEditing:animated:"
  },
  "title" : "setEditing(_:animated:)"
}
-->

# setEditing(_:animated:)

Toggles the cell into and out of editing mode.

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

## Parameters

`editing`

<doc://com.apple.documentation/documentation/Swift/true> to enter editing mode, <doc://com.apple.documentation/documentation/Swift/false> to leave it. The default value is <doc://com.apple.documentation/documentation/Swift/false>.

`animated`

<doc://com.apple.documentation/documentation/Swift/true> to animate the appearance or disappearance of the insertion/deletion control and the reordering control, <doc://com.apple.documentation/documentation/Swift/false> to make the transition immediate.

## Discussion

When you call this method with the value of `editing` set to <doc://com.apple.documentation/documentation/Swift/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:)`](/documentation/UIKit/UITableView/setEditing(_:animated:)) method of `UITableView` is invoked. Calling this method with `editing` set to <doc://com.apple.documentation/documentation/Swift/false> removes the controls from the cell.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)