<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Scene/commands(content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI5ScenePAAE8commands7contentQrqd__yXE_tAA8CommandsRd__lF"
  },
  "title" : "commands(content:)"
}
-->

# commands(content:)

Adds commands to the scene.

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

## 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.

---

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)