---
title: commandsRemoved()
framework: swiftui
role: symbol
role_heading: Instance Method
path: swiftui/scene/commandsremoved()
---

# commandsRemoved()

Removes all commands defined by the modified scene.

## Declaration

```swift
nonisolated func commandsRemoved() -> some Scene

```

## Return Value

Return Value A scene that excludes any commands defined by its children.

## Discussion

Discussion WindowGroup, Window, and other scene types all have an associated set of commands that they include by default. Apply this modifier to a scene to exclude those commands. For example, the following code adds a scene for presenting the details of an individual data model in a separate window. To ensure that the window can only appear programmatically, we remove the scene’s commands, including File > New Note Window. @main struct Example: App {     var body: some Scene {         ...

WindowGroup("Note", id: "note", for: Note.ID.self) {             NoteDetailView(id: $0)         }         .commandsRemoved()     } }

## See Also

### Defining commands

- [commands(content:)](swiftui/scene/commands(content:).md)
- [commandsReplaced(content:)](swiftui/scene/commandsreplaced(content:).md)
- [Commands](swiftui/commands.md)
- [CommandMenu](swiftui/commandmenu.md)
- [CommandGroup](swiftui/commandgroup.md)
- [CommandsBuilder](swiftui/commandsbuilder.md)
- [CommandGroupPlacement](swiftui/commandgroupplacement.md)
