Instance Method

onMove(perform:)

Sets the move action for the dynamic view.

Declaration

func onMove(perform action: Optional<(IndexSet, Int) -> Void>) -> some DynamicViewContent

Parameters

action

A closure that SwiftUI invokes when elements in the dynamic view are moved. The closure takes two arguments that represent the offset relative to the dynamic view’s underlying collection of data. Pass nil to disable the ability to move items.

Return Value

A view that calls action when elements are moved within the original view.

See Also

Responding to Updates