SwiftUI Advent Calendar Open
Interactive previews iPhone Duo iPhone iPad

Inspector

Adds an inspector to a view. It can appear as a trailing column in a regular horizontal size class or as a sheet in a compact horizontal size class.

Inspector - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 17.0+ iPadOS 17.0+ macOS 14.0+

SwiftUI Code

Docs
@State private var showInspector = true

var body: some View {
    Text("Foo")
        .inspector(isPresented: $showInspector) {
            Text("Bar")
        }
}

Found an issue or have a suggestion?

Created: December 6, 2026Updated: December 6, 2026

More View Components

View all
Dialog Icon - macOS - Liquid Glass - Light Mode - Preview
modifier

Dialog Icon

Configures the icon used by dialogs within this view. On macOS, this icon replaces the default icon of the app. On watchOS, this icon will be shown in any dialogs presented. This modifier has no effect on other platforms.

Text Tightening - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Text Tightening

Sets whether text in this view can compress the space between characters when necessary to fit text in a line.

Symbol Rendering Mode - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Symbol Rendering Mode

Sets the rendering mode for symbol images within this view.

Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Scroll Gesture Axis Lock

Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.

VisionOS background materials - visionOS - Liquid Glass - Light Mode - Preview
type

VisionOS background materials

All background materials on visionOS

Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Container Content Margins

Adds the margins of the container the view is in.

Toolbar Vertical Edge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
environment

Toolbar Vertical Edge

This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.

Hinge State - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
structure

Hinge State

A type encapsulating the state of a single hinge.

Explore Other Components

Browse all
Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Store View

Creates a view to load and merchandise a collection of products from the App Store using product identifiers. Internally, ProductView is used, and therefore productViewStyle can also be applied here.

Toggle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Toggle

Creates a toggle with title, image, systemImage, and custom label.

GroupBox - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

GroupBox

A simple GroupBox

Picker Divider - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
content

Picker Divider

A Picker with a Divider

Move Disabled - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
modifier

Move Disabled

Adds a condition for whether the view’s view hierarchy is movable.

RegularProductViewStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

RegularProductViewStyle

A style for a product view that uses a standard, platform-appropriate layout.

CompactProductViewStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

CompactProductViewStyle

A style for a product view that’s suitable for layouts with less available space, or for displaying more items in a small amount of space.

Split Arrangement Layout Ratio - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
modifier

Split Arrangement Layout Ratio

Sets the preferred size ratio for an arrangement view in a split style. Use this modifier when you want to customize the size of the view compared to its other views in the split layout.