SwiftUI Advent Calendar Open

iPhone SwiftUI layouts

Explore SwiftUI APIs, components, and modifiers with interactive iPhone previews, Swift code, and Apple documentation. Compare every available orientation, appearance, and design.

View

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.

Explore Inspector on iPhone in portrait and landscape, with SwiftUI code and Apple API documentation.

@State private var showInspector = true

var body: some View {
    Text("Foo")
        .inspector(isPresented: $showInspector) {
            Text("Bar")
        }
}
iOS 17.0+ iPadOS 17.0+ macOS 14.0+

Every available iPhone screenshot for Inspector.

2 views