One Logo Pool Ball
SwiftUI · IOS API REFERENCE

DragSession

struct · iOS 26.0+ · SDK 27.1

struct DragSession

Describes the ongoing dragging session.

Members (6)

method · iOS 26.0+

draggedItemIDs

TypeScript
draggedItemIDs(type: "Bool" | "Int" | "UInt" | "Double" | "Float" | "String" | "CGFloat" | "Date" | "URL" | "Data" | "UUID"): Array<unknown>
Swift declaration
func draggedItemIDs<ItemID>(for type: ItemID.Type) -> [ItemID] where ItemID : Hashable

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. Parameter type: The type of the identifiers. Returns: The array with the identifiers of the dragged items if provided. Returns an empty array if no dragged identifiers of a given type exist.

get · iOS 26.0+

draggedItemIndex

TypeScript
get draggedItemIndex(): number
Swift declaration
var draggedItemIndex: Int { get }

The index of the dragged item under the cursor.

get · iOS 26.0+

id

TypeScript
get id(): DragSession_ID
Swift declaration
var id: DragSession.ID { get }

The identifier of the drag session.

get · iOS 26.0+

phase

TypeScript
get phase(): DragSession_Phase
Swift declaration
var phase: DragSession.Phase { get }

The current phase of the drag session.

get · iOS 26.0+

location

TypeScript
get location(): { x: number; y: number }
Swift declaration
var location: CGPoint

Location of the drag session in the local coordinate space.

set · iOS 26.0+

location

TypeScript
set location(value: { x: number; y: number })
Swift declaration
var location: CGPoint

Location of the drag session in the local coordinate space.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →