Contents

DropDelegate

An interface that you implement to interact with a drop operation in a view modified to accept drops.

Declaration

@MainActor @preconcurrency protocol DropDelegate

Overview

The DropDelegate protocol provides a comprehensive and flexible way to interact with a drop operation. Specify a drop delegate when you modify a view to accept drops with the onDrop(of:delegate:) method.

Alternatively, for simple drop cases that don’t require the full functionality of a drop delegate, you can modify a view to accept drops using the onDrop(of:isTargeted:perform:) method. This method handles the drop using a closure you provide as part of the modifier.

Topics

Receiving drop information

See Also

Moving items using item providers