onCopyCommand(perform:)
Adds an action to perform in response to the system’s Copy command.
Declaration
nonisolated func onCopyCommand(perform payloadAction: (() -> [NSItemProvider])?) -> some View
Parameters
- payloadAction:
An action closure returning the Nsitemprovider items that should be copied to the Clipboard when the Copy command is triggered. If
actionisnil, the Copy command is considered disabled.
Return Value
A view that triggers action when a system Copy command occurs.