<!--
{
  "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/draggedItemIDs(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI11DragSessionV14draggedItemIDs3forSayxGxm_tSHRzlF"
  },
  "title" : "draggedItemIDs(for:)"
}
-->

# 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.

```
func draggedItemIDs<ItemID>(for type: ItemID.Type) -> [ItemID] where ItemID : Hashable
```

## Discussion

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.

---

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)