---
title: "insertRows(at:withAnimation:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstableview/insertrows(at:withanimation:)"
---

# insertRows(at:withAnimation:)

Inserts the rows using the specified animation.

## Declaration

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

## Parameters

- `indexes`: The final positions of the new rows to be inserted.
- `animationOptions`: The animation displayed during the insert. See doc://com.apple.appkit/documentation/AppKit/NSTableView/AnimationOptions for the possible values that can be combined using the C bitwise OR operator.

## Discussion

Discussion The numberOfRows in the table view is automatically increased by the count of indexes. Calling this method multiple times within the same beginUpdates() and endUpdates() block is allowed, and changes are processed incrementally. note: NSCell-based table views must first call beginUpdates() before calling this method.

## See Also

### Updating the Table View Arrangement

- [beginUpdates()](appkit/nstableview/beginupdates().md)
- [endUpdates()](appkit/nstableview/endupdates().md)
- [moveRow(at:to:)](appkit/nstableview/moverow(at:to:).md)
- [removeRows(at:withAnimation:)](appkit/nstableview/removerows(at:withanimation:).md)
- [row(for:)](appkit/nstableview/row(for:).md)
- [column(for:)](appkit/nstableview/column(for:).md)
