<!--
{
  "availability" : [
    "macOS: 10.7.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTableView/removeRows(at:withAnimation:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTableView(im)removeRowsAtIndexes:withAnimation:"
  },
  "title" : "removeRows(at:withAnimation:)"
}
-->

# removeRows(at:withAnimation:)

Removes the rows using the specified animation.

```
func removeRows(at indexes: IndexSet, withAnimation animationOptions: NSTableView.AnimationOptions = [])
```

## Parameters

`indexes`

An index set containing the rows to remove.

`animationOptions`

The animation displayed during the insert. See [`NSTableView.AnimationOptions`](/documentation/AppKit/NSTableView/AnimationOptions) for the possible values that can be combined using the C bitwise OR operator.

## Discussion

This method deletes from the table the rows represented at `indexes` and automatically decreases [`numberOfRows`](/documentation/AppKit/NSTableView/numberOfRows) by the count of `indexes`.

The row indexes should be with respect to the current state displayed in the table view, and not the final state, because the specified rows do not exist in the final state.

Calling this method multiple times within the same [`beginUpdates()`](/documentation/AppKit/NSTableView/beginUpdates()) and [`endUpdates()`](/documentation/AppKit/NSTableView/endUpdates()) block is allowed, and changes are processed incrementally.

Changes are processed incrementally as the [`insertRows(at:withAnimation:)`](/documentation/AppKit/NSTableView/insertRows(at:withAnimation:)), [`removeRows(at:withAnimation:)`](/documentation/AppKit/NSTableView/removeRows(at:withAnimation:)), and the [`moveRow(at:to:)`](/documentation/AppKit/NSTableView/moveRow(at:to:)) methods are called. It is acceptable to delete row `0` multiple times, as long as there is still a row available.

> Note:
> ``doc://com.apple.appkit/documentation/AppKit/NSCell``-based table views must first call ``doc://com.apple.appkit/documentation/AppKit/NSTableView/beginUpdates()`` before calling this method.

---

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)