<!--
{
  "availability" : [
    "iOS: 17.0.0 -",
    "iPadOS: 17.0.0 -",
    "macCatalyst: 17.0.0 -",
    "macOS: 14.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/InspectorCommands",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17InspectorCommandsV"
  },
  "title" : "InspectorCommands"
}
-->

# InspectorCommands

A built-in set of commands for manipulating inspectors.

```
nonisolated struct InspectorCommands
```

## Overview

`InspectorCommands` include a command for toggling the presented state of
the inspector with a keyboard shortcut of Control-Command-I.

These commands are optional and can be explicitly requested by passing a
value of this type to the [`commands(content:)`](/documentation/SwiftUI/Scene/commands(content:)) modifier:

```
@State var presented = true
WindowGroup {
    MainView()
        .inspector(isPresented: $presented) {
            InspectorView()
        }
}
.commands {
    InspectorCommands()
}
```

## Topics

### Creating a command

[`init()`](/documentation/SwiftUI/InspectorCommands/init())

A new value describing the built-in inspector-related commands.

## Relationships

### Conforms To

[`Commands`](/documentation/SwiftUI/Commands)

---

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)