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

# removeItems(at:inParent:withAnimation:)

Removes items at the given indexes in the given parent with the specified optional animations.

```
func removeItems(at indexes: IndexSet, inParent parent: Any?, withAnimation animationOptions: NSTableView.AnimationOptions = [])
```

## Parameters

`indexes`

Indexes of the items to be removed.

`parent`

The parent of the items to be removed.

`animationOptions`

Animated slide effects used when removing items.

## Discussion

This method parallels the [`removeRows(at:withAnimation:)`](/documentation/AppKit/NSTableView/removeRows(at:withAnimation:)) method of [`NSTableView`](/documentation/AppKit/NSTableView) and is used in a way similar to the <doc://com.apple.documentation/documentation/Foundation/NSMutableArray/removeObjects(at:)> method of <doc://com.apple.documentation/documentation/Foundation/NSMutableArray>. The method does nothing if `parent` is not expanded. If any of the child items is expanded, then all of its child rows are also be removed.

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

You can call this method multiple times within the same [`beginUpdates()`](/documentation/AppKit/NSTableView/beginUpdates())/[`endUpdates()`](/documentation/AppKit/NSTableView/endUpdates()) block; changes work just like modifying an array. Removing an item at an index beyond what is available throws an exception.

---

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)