---
title: "onDrop(of:delegate:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/ondrop(of:delegate:)"
---

# onDrop(of:delegate:)

Defines the destination of a drag and drop operation using behavior controlled by the delegate that you provide.

## Declaration

```swift
nonisolated func onDrop(of supportedContentTypes: [UTType], delegate: any DropDelegate) -> some View

```

## Parameters

- `supportedContentTypes`: The uniform type identifiers that describe the types of content this view can accept through drag and drop. If the drag and drop operation doesn’t contain any of the supported types, then this drop destination doesn’t activate and isTargeted doesn’t update.
- `delegate`: A type that conforms to the doc://com.apple.SwiftUI/documentation/SwiftUI/DropDelegate protocol. You have comprehensive control over drop behavior when you use a delegate.

## Return Value

Return Value A view that provides a drop destination for a drag operation of the specified types.

## Discussion

Discussion To use Transferable types directly and access a richer feature set — including support for DropSession — use dropDestination(for:isEnabled:action:) instead.

## See Also

### Moving items using item providers

- [itemProvider(_:)](swiftui/view/itemprovider(_:).md)
- [onDrag(_:preview:)](swiftui/view/ondrag(_:preview:).md)
- [onDrag(_:)](swiftui/view/ondrag(_:).md)
- [onDrop(of:isTargeted:perform:)](swiftui/view/ondrop(of:istargeted:perform:).md)
- [DropDelegate](swiftui/dropdelegate.md)
- [DropProposal](swiftui/dropproposal.md)
- [DropOperation](swiftui/dropoperation.md)
- [DropInfo](swiftui/dropinfo.md)
