Contents

onDelete(perform:)

Sets the deletion action for the dynamic view. You must delete the corresponding item within action, as it will be called after the row has already been removed from the List.

Declaration

nonisolated 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.

Mentioned in

Return Value

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

See Also

Responding to updates