<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/onDrop(of:delegate:)-6lin8",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE6onDrop2of8delegateQrSay22UniformTypeIdentifiers6UTTypeVG_AA0E8Delegate_ptF"
  },
  "title" : "onDrop(of:delegate:)"
}
-->

# onDrop(of:delegate:)

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

```
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 `DropDelegate` protocol. You
have comprehensive control over drop behavior when you use a
delegate.

## Return Value

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

## Discussion

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)