---
title: "inspector(isPresented:content:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/inspector(ispresented:content:)"
---

# inspector(isPresented:content:)

Inserts an inspector at the applied position in the view hierarchy.

## Declaration

```swift
nonisolated func inspector<V>(isPresented: Binding<Bool>, @ContentBuilder content: () -> V) -> some View where V : View

```

## Parameters

- `isPresented`: A binding to Bool controlling the presented state.
- `content`: The inspector content.

## Discussion

Discussion Apply this modifier to declare an inspector with a context-dependent presentation. For example, an inspector can present as a trailing column in a horizontally regular size class, but adapt to a sheet in a horizontally compact size class. struct ShapeEditor: View {     @State var presented: Bool = false     var body: some View {         MyEditorView()             .inspector(isPresented: $presented) {                 TextTraitsInspectorView()             }     } } note: Trailing column inspectors have their presentation state restored by the framework. note: InspectorCommands for including the default inspector commands and keyboard shortcuts.

## See Also

### Presenting an inspector

- [inspectorColumnWidth(_:)](swiftui/view/inspectorcolumnwidth(_:).md)
- [inspectorColumnWidth(min:ideal:max:)](swiftui/view/inspectorcolumnwidth(min:ideal:max:).md)
