---
title: "reorderDestination(for:itemID:in:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/dropsession/reorderdestination(for:itemid:in:)"
---

# reorderDestination(for:itemID:in:)

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

## Declaration

```swift
nonisolated func reorderDestination<Item, ItemID, CollectionID>(for item: Item.Type, itemID: KeyPath<Item, ItemID>, in collectionID: CollectionID.Type = ReorderableSingleCollectionIdentifier.self) -> ReorderDifference<ItemID, CollectionID>.Destination?
```

## Discussion

Discussion Use the ItemID and CollectionID types of your reorderContainer(for:in:isEnabled:move:) modifier to look up the destination value. This value can be nil, if the container was unable to determine a placement for the items. This can happen if the user drags items into the destination but does not interact with any of the container items to determine a concrete position. You should still accept these items into the container. In this example, those values are appended to the end of the collection: struct ContentView: View {     @State var accounts: [Account] = []

var body: some View {         VStack {             ForEach(accounts, id: \.uuid) { account in                 AccountView(account)             }             .reorderable()         }         .reorderContainer(for: Account.self, itemID: \.uuid) {             (difference) in             difference.apply(to: &accounts)         }         .dragContainer(for: Account.self) { userIDs in             findAccounts(ids: userIDs)         }         .dropDestination(for: Account.self) { items, session in             if let destinationIndex = session.reorderDestination(                 for: Account.self, itemID: \.uuid)?.index(                     in: accounts)             {                 accounts.insert(                     contentsOf: items, at: destinationIndex)             } else {                 accounts.append(contentsOf: items)             }         }     } } item: The type of reorderable items in the container. collectionID: The identifier type for collections in your container.

## See Also

### Reordering items

- [Making a card game with drag, drop, and reordering in SwiftUI](swiftui/making-a-card-game-with-drag-drop-and-reordering-in-swiftui.md)
- [reorderable()](swiftui/dynamicviewcontent/reorderable().md)
- [reorderable(collectionID:)](swiftui/dynamicviewcontent/reorderable(collectionid:).md)
- [ReorderableSingleCollectionIdentifier](swiftui/reorderablesinglecollectionidentifier.md)
- [reorderContainer(for:isEnabled:move:)](swiftui/view/reordercontainer(for:isenabled:move:).md)
- [reorderContainer(for:in:isEnabled:move:)](swiftui/view/reordercontainer(for:in:isenabled:move:).md)
- [reorderContainer(for:itemID:isEnabled:move:)](swiftui/view/reordercontainer(for:itemid:isenabled:move:).md)
- [reorderContainer(for:itemID:in:isEnabled:move:)](swiftui/view/reordercontainer(for:itemid:in:isenabled:move:).md)
- [reorderDestination(for:in:)](swiftui/dropsession/reorderdestination(for:in:).md)
- [ReorderDifference](swiftui/reorderdifference.md)
