The types of content that the view supports exporting and importing. An empty array means the view does not currently support exporting.
Instance Method
インスタンスメソッド
exports
exportsItemProviders(_:onExport:onEdit:)
Exports a read-write item provider for consumption by shortcuts, quick actions, and services.
Availability 有効性
- macOS 12.0+
Technology
- Swift
UI
Declaration 宣言
func exportsItemProviders(_ contentTypes: [UTType
], onExport: @escaping () -> [NSItemProvider
], onEdit: @escaping ([NSItemProvider
]) -> Bool
) -> some View
Parameters パラメータ
contentTypes
onExport
A closure that will be called on request of the items by the shortcut or service.
onEdit
A closure that will be called after the shortcut or service completes with its output data. This should replace the selected subpart that was exported with
on
. ReturnExport false
to indicate that there was a failure to receive the items.
Discussion 議論
If the associated view supports selection, the exported item should reflect that selected subpart.