Instance Method

onCutCommand(perform:)

Adds an action to perform in response to the system’s Cut command.

Declaration

func onCutCommand(perform payloadAction: (() -> [NSItemProvider])?) -> some View

See Also

Handling View Events

func onAppear(perform: (() -> Void)?) -> View

Adds an action to perform when the view appears.

func onDisappear(perform: (() -> Void)?) -> View

Adds an action to perform when the view disappears.

func onCommand(Selector, perform: (() -> Void)?) -> View

Adds an action to perform in response to the given selector.

func onCopyCommand(perform: (() -> [NSItemProvider])?) -> View

Adds an action to perform in response to the system’s Copy command.

func onDeleteCommand(perform: (() -> Void)?) -> View

Adds an action to perform in response to the system’s Delete command.

func onExitCommand(perform: (() -> Void)?) -> View

Sets up an action that triggers in response to receiving the exit command while the view has focus.

func onMoveCommand(perform: ((MoveCommandDirection) -> Void)?) -> View

Adds an action to perform in response to a move command, like when the user presses an arrow key on a Mac keyboard, or taps the edge of the Siri Remote when controlling an Apple TV.

func onPasteCommand(of: [String], perform: ([NSItemProvider]) -> Void) -> View

Adds an action to perform in response to the system’s Paste command.

func onPasteCommand<Payload>(of: [String], validator: ([NSItemProvider]) -> Payload?, perform: (Payload) -> Void) -> View

Adds an action to perform in response to the system’s Paste command with items that you validate.

func onPlayPauseCommand(perform: (() -> Void)?) -> View

Adds an action to perform in response to the system’s Play/Pause command.

func onReceive<P>(P, perform: (P.Output) -> Void) -> View

Adds an action to perform when this view detects data emitted by the given publisher.