<!--
{
  "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/UITableView/setEditing(_:animated:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UITableView(im)setEditing:animated:"
  },
  "title" : "setEditing(_:animated:)"
}
-->

# setEditing(_:animated:)

Toggles the table view 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 transition to editing mode; <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>, the table view goes into editing mode by calling [`setEditing(_:animated:)`](/documentation/UIKit/UITableViewCell/setEditing(_:animated:)) on each visible `UITableViewCell` object. Calling this method with `editing` set to <doc://com.apple.documentation/documentation/Swift/false> turns off editing mode. In editing mode, the cells of the table might show an insertion or deletion control on the left side of each cell and a reordering control on the right side, depending on how the cell is configured. (See [`UITableViewCell`](/documentation/UIKit/UITableViewCell) for details.) The data source of the table view can selectively exclude cells from editing mode by implementing [`tableView(_:canEditRowAt:)`](/documentation/UIKit/UITableViewDataSource/tableView(_:canEditRowAt:)).

---

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)