---
title: "commands(content:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/scene/commands(content:)"
---

# commands(content:)

Adds commands to the scene.

## Declaration

```swift
nonisolated func commands<Content>(@ContentBuilder content: () -> Content) -> some Scene where Content : Commands

```

## Mentioned in

Building and customizing the menu bar with SwiftUI

## Discussion

Discussion Commands are realized in different ways on different platforms. On macOS, the main menu uses the available command menus and groups to organize its main menu items. Each menu is represented as a top-level menu bar menu, and each command group has a corresponding set of menu items in one of the top-level menus, delimited by separator menu items. On iPadOS, commands with keyboard shortcuts are exposed in the shortcut discoverability HUD that users see when they hold down the Command (⌘) key.

## See Also

### Defining commands

- [commandsRemoved()](swiftui/scene/commandsremoved().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)
