<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/View/dropConfiguration(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI4ViewPAAE17dropConfigurationyQrAA04DropE0VAA0F7SessionVcF"
  },
  "title" : "dropConfiguration(_:)"
}
-->

# dropConfiguration(_:)

Configures a drop session.

```
nonisolated func dropConfiguration(_ configuration: @escaping (DropSession) -> DropConfiguration) -> some View
```

## Parameters

`configuration`

A value that describes the configuration
of a drop session.

## Return Value

A view that configures a drop session in a way, described
by the return value of the `configuration` parameter.

## Discussion

Below is an example of a view that accepts drop of `Image` type.
The view prefers drop operation `move` in a case when the source
supports it (the source will remove the images from its storage after
the drop operation).
If the source does not support moving images, the destination
will make copies.

```
       ExampleView()
           .dropDestination(for: Image.self) { images, _ in
               process(images)
           }
           .dropConfiguration { dropSession in
               if dropSession.suggestedOperations.contains(.move) {
                   return DropConfiguration(operation: .move)
               }
               return DropConfiguration(operation: .copy)
           }
```

> Note: The closure that provides the configuration is called
> frequently to allow specifying different operations for different drop
> locations in a view. Do not perform any expensive calculations in it.

---

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)