<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/DropSession",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11DropSessionV"
  },
  "title" : "DropSession"
}
-->

# DropSession

A description of a drop that is in progress.

```
struct DropSession
```

## Overview

Read [`location`](/documentation/SwiftUI/DropSession/location) to find where the drop landed,
[`itemsCount`](/documentation/SwiftUI/DropSession/itemsCount) for how many items it carries, and
[`phase`](/documentation/SwiftUI/DropSession/phase-swift.property) to follow the drag through its lifecycle.

The following example animates a drop at the point of the drop:

```
Color.pink
    .frame(width: 400, height: 400)
    .dropDestination(for: String.self) { titles, session in
        process(titles: titles)
    }
```

To follow a drag while its phases change,
apply [`onDropSessionUpdated(_:)`](/documentation/SwiftUI/View/onDropSessionUpdated(_:)).

Use [`localSession`](/documentation/SwiftUI/DropSession/localSession-swift.property) to recognize a drag that started inside
your own app. It is `nil` for a drag that came from elsewhere.

## Topics

### Getting drop session details

[`var id: DropSession.ID`](/documentation/SwiftUI/DropSession/id-swift.property)

The unique identifier of the drop session.

[`struct ID`](/documentation/SwiftUI/DropSession/ID-swift.struct)

The identifier of a drag session.

[`var localSession: DropSession.LocalSession?`](/documentation/SwiftUI/DropSession/localSession-swift.property)

Provides additional information about a session
if it originated within the app.

[`struct LocalSession`](/documentation/SwiftUI/DropSession/LocalSession-swift.struct)

Describes the session originated within the app.

[`var phase: DropSession.Phase`](/documentation/SwiftUI/DropSession/phase-swift.property)

The phase of the current drop session.

[`enum Phase`](/documentation/SwiftUI/DropSession/Phase-swift.enum)

The phase of the current drop session.

[`var suggestedOperations: DropOperation.Set`](/documentation/SwiftUI/DropSession/suggestedOperations)

Operations suggested by the drag source.

### Getting drop details

[`var itemsCount: Int`](/documentation/SwiftUI/DropSession/itemsCount)

Number of items for the drop.

[`var location: CGPoint`](/documentation/SwiftUI/DropSession/location)

Location of drop in the local coordinate space

[`var size: CGSize`](/documentation/SwiftUI/DropSession/size)

Size of the drop destination view.

### Supporting reordering

[`func reorderDestination<Item, CollectionID>(for: Item.Type, in: CollectionID.Type) -> ReorderDifference<Item.ID, CollectionID>.Destination?`](/documentation/SwiftUI/DropSession/reorderDestination(for:in:))

Provides the destination value of a reordering operation that occurred
in the container associated with this drop destination modifier.

[`func reorderDestination<Item, ItemID, CollectionID>(for: Item.Type, itemID: KeyPath<Item, ItemID>, in: CollectionID.Type) -> ReorderDifference<ItemID, CollectionID>.Destination?`](/documentation/SwiftUI/DropSession/reorderDestination(for:itemID:in:))

Provides the destination value of a reordering operation that occurred
in the container associated with this drop destination modifier.

## Relationships

### Conforms To

[`Copyable`](/documentation/Swift/Copyable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Identifiable`](/documentation/Swift/Identifiable)

[`Escapable`](/documentation/Swift/Escapable)

---

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)