---
title: "reorderable(collectionID:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/dynamicviewcontent/reorderable(collectionid:)"
---

# reorderable(collectionID:)

Enables the views of this content to be reordered when used within the scope of a reorderContainer(for:in:isEnabled:move:) modifier.

## Declaration

```swift
nonisolated func reorderable(collectionID: some Hashable & Sendable) -> some DynamicViewContent<Self.Data>

```

## Mentioned in

Reordering items in lists, stacks, grids, and custom layouts

## Discussion

Discussion Declare this modifier on DynamicViewContent within a reorderable container to allow your users to reorder the items in the content using a system drag gesture. Provide a collection identifier when you have multiple collections in the container and need to uniquely refer to each one. If your container only has a single collection, you can use the default identifier. This example shows a sectioned list of reminders: struct ContentView: View {     @State private var model = ReminderModel()

var body: some View {         List {             ForEach(model.sections) { section in                 Section(section.name) {                     ForEach(section.reminders) { reminder in                         ReminderView(reminder)                     }                     .reorderable(collectionID: section.id)                 }             }         }         .reorderContainer(             for: Reminder.self, in: ReminderModel.Section.ID.self         ) { difference in             model.apply(difference: difference)         }     } } collectionID: The identifier that represents this collection. Its value is used in the destination value when reordering.

## 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)
- [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)
- [reorderDestination(for:itemID:in:)](swiftui/dropsession/reorderdestination(for:itemid:in:).md)
- [ReorderDifference](swiftui/reorderdifference.md)
