Instance Method

onDisappear(perform:)

Adds an action to perform when this view disappears.

Declaration

func onDisappear(perform action: (() -> Void)? = nil) -> some View

Parameters

action

The action to perform. If action is nil, the call has no effect.

Return Value

A view that triggers action when this view disappears.

See Also

Handling View Events

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

Adds an action to perform when this view appears.