One Logo Pool Ball
SwiftUI · IOS API REFERENCE

WindowResizability

struct · iOS 17.0+ · SDK 27.1

struct WindowResizability

The resizability of a window. Use the ``Scene/windowResizability(_:)`` scene modifier to apply a value of this type to a ``Scene`` that you define in your ``App`` declaration. The value that you specify indicates the strategy the system uses to place minimum and maximum size restrictions on windows that it creates from that scene. For example, you can create a window group that people can resize to between 100 and 400 points in both dimensions by applying both a frame with those constraints to the scene's content, and the ``WindowResizability/contentSize`` resizability to the scene: @main struct MyApp: App { var body: some Scene { WindowGroup { ContentView() .frame( minWidth: 100, maxWidth: 400, minHeight: 100, maxHeight: 400) } .windowResizability(.contentSize) } } The default value for all scenes if you don't apply the modifier is ``WindowResizability/automatic``. With that strategy, ``Settings`` windows use the ``WindowResizability/contentSize`` strategy, while all others use ``WindowResizability/contentMinSize``. Windows on visionOS with a window style of ``WindowStyle/volumetric`` also use the ``WindowResizability/contentSize`` strategy.

Members (6)

get · iOS 17.0+

contentSize

TypeScript
static get contentSize(): WindowResizability
Swift declaration
static var contentSize: WindowResizability { get set }

A window resizability that's derived from the window's content. Windows that use this resizability have: * A minimum size that matches the minimum size of the window's content. * A maximum size that matches the maximum size of the window's content.

set · iOS 17.0+

contentSize

TypeScript
static set contentSize(value: WindowResizability)
Swift declaration
static var contentSize: WindowResizability { get set }

A window resizability that's derived from the window's content. Windows that use this resizability have: * A minimum size that matches the minimum size of the window's content. * A maximum size that matches the maximum size of the window's content.

get · iOS 17.0+

contentMinSize

TypeScript
static get contentMinSize(): WindowResizability
Swift declaration
static var contentMinSize: WindowResizability { get set }

A window resizability that's partially derived from the window's content. Windows that use this resizability have: * A minimum size that matches the minimum size of the window's content. * No maximum size.

set · iOS 17.0+

contentMinSize

TypeScript
static set contentMinSize(value: WindowResizability)
Swift declaration
static var contentMinSize: WindowResizability { get set }

A window resizability that's partially derived from the window's content. Windows that use this resizability have: * A minimum size that matches the minimum size of the window's content. * No maximum size.

get · iOS 17.0+

automatic

TypeScript
static get automatic(): WindowResizability
Swift declaration
static var automatic: WindowResizability { get set }

The automatic window resizability. When you use automatic resizability, SwiftUI applies a resizing strategy that's appropriate for the scene type: * Windows from ``WindowGroup``, ``Window``, and ``DocumentGroup`` scene declarations use the ``contentMinSize`` strategy. * A window from a ``Settings`` scene declaration uses the ``contentSize`` strategy. * Windows on visionOS with a window style of ``WindowStyle/volumetric`` use the ``contentSize`` strategy. Automatic resizability is the default if you don't specify another value using the ``Scene/windowResizability(_:)`` scene modifier.

set · iOS 17.0+

automatic

TypeScript
static set automatic(value: WindowResizability)
Swift declaration
static var automatic: WindowResizability { get set }

The automatic window resizability. When you use automatic resizability, SwiftUI applies a resizing strategy that's appropriate for the scene type: * Windows from ``WindowGroup``, ``Window``, and ``DocumentGroup`` scene declarations use the ``contentMinSize`` strategy. * A window from a ``Settings`` scene declaration uses the ``contentSize`` strategy. * Windows on visionOS with a window style of ``WindowStyle/volumetric`` use the ``contentSize`` strategy. Automatic resizability is the default if you don't specify another value using the ``Scene/windowResizability(_:)`` scene modifier.

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUI types →