<!--
{
  "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/DragSession",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11DragSessionV"
  },
  "title" : "DragSession"
}
-->

# DragSession

Describes the ongoing dragging session.

```
struct DragSession
```

## Topics

### Structures

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

The identifier of a drag session.

### Instance Properties

[`var draggedItemIndex: Int`](/documentation/SwiftUI/DragSession/draggedItemIndex)

The index of the dragged item under the cursor.

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

The identifier of the drag session.

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

Location of the drag session in the local coordinate space.

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

The current phase of the drag session.

### Instance Methods

[`func draggedItemIDs<ItemID>(for: ItemID.Type) -> [ItemID]`](/documentation/SwiftUI/DragSession/draggedItemIDs(for:))

Provides an array of identifiers of the currently dragged items
in a case when the items conform to the `Identifiable` protocol,
or identifiers were provided to SwiftUI separately.

### Enumerations

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

The phase of the current drag session

## Relationships

### Conforms To

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

---

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)