---
title: "dropDestination(for:isEnabled:action:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/dropdestination(for:isenabled:action:)"
---

# dropDestination(for:isEnabled:action:)

Defines the destination of a drag and drop operation that provides a drop operation proposal and handles the dropped content with a closure that you specify.

## Declaration

```swift
nonisolated func dropDestination<T>(for type: T.Type = T.self, isEnabled: Bool = true, action: @escaping ([T], DropSession) -> Void) -> some View where T : Transferable

```

## Parameters

- `type`: The expected type of the dropped models.
- `isEnabled`: The Boolean value indicating if the view accepts drop interactions.
- `action`: A closure that takes the dropped content and responds appropriately. The first parameter to action contains the dropped items. The second parameter contains the drop session description.

## Mentioned in

Reordering items in lists, stacks, grids, and custom layouts

## Return Value

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

## Discussion

Discussion The dropped content can be provided as binary data, file URLs, or file promises. The drop destination is the same size and position as this view. @State private var isDropTargeted = false @Binding var isDropEnabled: Bool

var body: some View {     Color.pink         .frame(width: 400, height: 400)         .dropDestination(             for: String.self, isEnabled: isDropEnabled         ) { receivedTitles, session in             animateDrop(at: session.location)             process(titles: receivedTitles)         } }

func process(titles: [String]) { ... } func animateDrop(at: CGPoint) { ... }

## See Also

### Drag and drop

- [dragConfiguration(_:)](swiftui/view/dragconfiguration(_:).md)
- [dragContainer(for:in:_:)](swiftui/view/dragcontainer(for:in:_:).md)
- [dragContainer(for:itemID:in:_:)](swiftui/view/dragcontainer(for:itemid:in:_:).md)
- [dragContainerSelection(_:containerNamespace:)](swiftui/view/dragcontainerselection(_:containernamespace:).md)
- [dragPreviewsFormation(_:)](swiftui/view/dragpreviewsformation(_:).md)
- [draggable(_:)](swiftui/view/draggable(_:).md)
- [draggable(_:preview:)](swiftui/view/draggable(_:preview:).md)
- [draggable(_:containerNamespace:_:)](swiftui/view/draggable(_:containernamespace:_:).md)
- [draggable(_:id:containerNamespace:_:)](swiftui/view/draggable(_:id:containernamespace:_:).md)
- [draggable(_:id:item:containerNamespace:)](swiftui/view/draggable(_:id:item:containernamespace:).md)
- [draggable(_:item:containerNamespace:)](swiftui/view/draggable(_:item:containernamespace:).md)
- [draggable(containerItemID:containerNamespace:)](swiftui/view/draggable(containeritemid:containernamespace:).md)
- [dropConfiguration(_:)](swiftui/view/dropconfiguration(_:).md)
- [dropPreviewsFormation(_:)](swiftui/view/droppreviewsformation(_:).md)
- [itemProvider(_:)](swiftui/view/itemprovider(_:).md)
