<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 12.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/DynamicTableRowContent/onInsert(of:perform:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI22DynamicTableRowContentPAAE8onInsert2of7performAA08ModifiedF0VyxAA02OnhdE8ModifierVGSay22UniformTypeIdentifiers6UTTypeVG_ySi_SaySo14NSItemProviderCGtctF"
  },
  "title" : "onInsert(of:perform:)"
}
-->

# onInsert(of:perform:)

Sets the insert action for the dynamic table rows.

```
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

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

---

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)