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

ControlSize

A control version that is the default size

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

VStack {
    Button("Tap Me", action: action)
        .buttonStyle(.borderedProminent)
        .controlSize(.mini)
    Button("Tap Me", action: action)
        .buttonStyle(.borderedProminent)
        .controlSize(.small)
    Button("Tap Me", action: action)
        .buttonStyle(.borderedProminent)
        .controlSize(.regular)
    Button("Tap Me", action: action)
        .buttonStyle(.borderedProminent)
        .controlSize(.large)
    Button("Tap Me", action: action)
        .buttonStyle(.borderedProminent)
    // only on visionOS bigger than large
        .controlSize(.extraLarge)

}
iOS 15.0+ iPadOS 15.0+ macOS 10.15+ watchOS 9.0+ tvOS 15.0+ visionOS 1.0+

Every available iPhone screenshot for ControlSize.

2 views