What this thread does
Do first: replace competing modal booleans with one optional Identifiable item bound to sheet(item:onDismiss:content:).
Short answer
As of November 2026, current SwiftUI docs describe a non-nil item as the presentation source and an item change as dismissal/replacement (source.md)). Use a stable-identity enum or model to make incompatible modal choices mutually exclusive. This is a state-design choice; the 2019 multiple-sheet report does not establish a current platform prohibition.
Choose / don't choose
- One optional item: choose when only one of several modal choices may be active.
- Boolean sheet: choose for a single independent yes/no presentation.
- Nested flow: choose when the second view is part of the current task rather than an unrelated competing modal; a sheet helps people perform a scoped task (Sheets, updated March 24, 2026).
Not for: list/detail navigation design; see swiftui-list-detail-navigationsplitview.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
@State optional item | Use a single optional modal model; the type conforms to Identifiable | Current SwiftUI sheet docs | source.md) |
sheet(item:onDismiss:content:) / item | Bind the optional with $; set non-nil to present; the example sets sheetDetail = nil on tap | Current SwiftUI sheet docs | source.md) |
onDismiss | Default nil; provide a closure to clear modal-only draft state and process a queued next choice | Current SwiftUI docs; queue is application policy | source.md) |
Identifiable identity | Use stable data identity; derive from a stable case/entity identity, not a fresh computed random value | Current SwiftUI identity guidance | source |
Order of operations
1. Define the mutually exclusive choices and stable identities. Store only one active optional item; dispatch its value in the sheet content closure. 2. For an intentional handoff, record the next choice separately and set the active item to nil first. 3. In onDismiss, clear state belonging to the dismissed modal, consume the queued choice, then assign it as the new active item. This queue is application policy built on the documented dismissal callback.md), not a prescribed delay or guarantee about arbitrary animation timing. 4. Consume the queue once. Do not unconditionally set the active item to nil after assigning the next one; that would immediately dismiss the new presentation.
Known failures and fixes
| Error or symptom | Cause | Fix | Source |
|---|---|---|---|
| Sheet is unexpectedly replaced (symptom) | The presentation item/identity changes while visible | Keep the active identity stable; use an intentional dismissal and queue for a new modal | source.md); source |
| Modal state disappears or resets (symptom) | Computed random or position-based identity shortens view lifetime | Use stable unique identity; keep draft state owned by the intended modal lifetime | source |
Missing
- The sheet reference does not specify a universal animation delay for chained presentations. Use the dismissal callback and a single-owner queue.
- Mutually exclusive state does not implement simultaneous independent windows.
Checked
2026-11-12; linked sources read. No application commands executed.
Started from a post by @Apple, packaged by the editor. Original post