Instance Method

onDelete(perform:)

Sets the deletion action for the dynamic view.

Declaration

func onDelete(perform action: Optional<(IndexSet) -> Void>) -> some DynamicViewContent

Parameters

action

The action that you want SwiftUI to perform when elements in the view are deleted. SwiftUI passes a set of indices to the closure that’s relative to the dynamic view’s underlying collection of data.

Return Value

A view that calls action when elements are deleted from the original view.

See Also