Instance Method インスタンスメソッド

onInsert(of:perform:)

Sets the insert action for the dynamic table rows.

Declaration 宣言

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

Return Value 戻り値

A view that calls action when elements are inserted into the original view. あるビュー、それは要素が元のビューに挿入される時にactionを呼び出します。

Parameters パラメータ

supportedContentTypes

An array of UTI types that the rows supports.

action

A closure that SwiftUI invokes when elements are added 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. クロージャは2つの引数をとります:最初の引数は、動的ビューのもつ基礎をなすデータのコレクションに相対的なオフセットです。 The second argument is an array of NSItemProvider items that represents the data that you want to insert.