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

onInsert(of:perform:)

Sets the insert action for the dynamic view. 動的ビューに対して挿入アクションを設定します。

Declaration 宣言

func onInsert(of supportedContentTypes: [UTType], perform action: @escaping (Int, [NSItemProvider]) -> Void) -> some DynamicViewContent

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 dynamic view supports. 動的ビューをサポートするUTI型それらからなるある配列。

action

A closure that SwiftUI invokes when elements are added to the view. The closure takes two arguments: The first argument is the offset relative to the dynamic view’s underlying collection of data. あるクロージャ、それは要素それらがビューに加えられる時にSwiftUIが発動します。クロージャは2つの引数をとります:最初の引数は、動的ビューのもつ基礎をなすデータのコレクションに相対的なオフセットです。 The second argument is an array of NSItemProvider items that represents the data that you want to insert.

See Also 参照

Responding to Updates 更新に応答する