onDelete

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.

DynamicViewContent ModifieriOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+onDelete(perform:) in SwiftUI

Declaration

React
compose().onDelete({
  perform: ((arg0: number[]) => void) | null,
})
Swift
nonisolated func onDelete(
    perform action: Optional<(IndexSet) -> Void>
) -> some DynamicViewContent

Parameters

  • options.perform*((arg0: number[]) => void) | null

Return value

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

See also

More in DynamicViewContent modifiers.