---
title: "onInsert(of:perform:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/dynamictablerowcontent/oninsert(of:perform:)"
---

# onInsert(of:perform:)

Sets the insert action for the dynamic table rows.

## Declaration

```swift
func onInsert(of supportedContentTypes: [UTType], perform action: @escaping (Int, [NSItemProvider]) -> Void) -> ModifiedContent<Self, OnInsertTableRowModifier>
```

## Parameters

- `supportedContentTypes`: An array of universal type identifiers types that the rows supports.
- `action`: A closure that SwiftUI invokes when adding elements to the collection of rows. The closure takes two arguments. The first argument is the offset relative to the dynamic view’s underlying collection of data. The second argument is an array of doc://com.apple.documentation/documentation/Foundation/NSItemProvider items that represents the data that you want to insert.

## Return Value

Return Value A view that calls action when inserting elements into the original view.

## See Also

### Inserting rows

- [OnInsertTableRowModifier](swiftui/oninserttablerowmodifier.md)
