<!--
{
  "availability" : [
    "iOS: 27.0.0 -",
    "iPadOS: 27.0.0 -",
    "macCatalyst: 27.0.0 -",
    "macOS: 27.0.0 -",
    "visionOS: 27.0.0 -",
    "watchOS: 27.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/DynamicViewContent/reorderable(collectionID:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI18DynamicViewContentPAAE11reorderable12collectionIDQrqd___tSHRd__s8SendableRd__lF"
  },
  "title" : "reorderable(collectionID:)"
}
-->

# reorderable(collectionID:)

Enables reordering views from this content within and between sections
in the scope of a reorderable container modifier.

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

## Parameters

`collectionID`

The identifier that represents this collection. Its
value is used in the destination value when reordering.

## Discussion

Declare this modifier on [`DynamicViewContent`](/documentation/SwiftUI/DynamicViewContent) within a reorderable
container to allow people to reorder the items in the content using a
system drag gesture. A reorderable container is a list, stack, grid,
or custom layout that you define with the
[`reorderContainer(for:in:isEnabled:move:)`](/documentation/SwiftUI/View/reorderContainer(for:in:isEnabled:move:)) modifier.

Use this modifier when you have multiple collections in the container.
Provide a collection identifier to uniquely identify the collection. If
your container has a single collection, provide
[`ReorderableSingleCollectionIdentifier`](/documentation/SwiftUI/ReorderableSingleCollectionIdentifier) as the identifier, or use
[`reorderable()`](/documentation/SwiftUI/DynamicViewContent/reorderable()) instead.

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)
        }
    }
}
```

---

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)