Contents

Windows

Display user interface content in a window or a collection of windows.

Overview

The most common way to present a view hierarchy in your app’s interface is with a WindowGroup, which produces a platform-specific behavior and appearance.

[Image]

On platforms that support it, people can open multiple windows from the group simultaneously. Each window relies on the same root view definition, but retains its own view state. On some platforms, you can also supplement your app’s user interface with a single-instance window using the Window scene type.

Configure windows using scene modifiers that you add to the window declaration, like windowStyle(_:) or defaultPosition(_:). You can also indicate how to configure new windows that you present from a view hierarchy by adding the presentedWindowStyle(_:) view modifier to a view in the hierarchy.

For design guidance, see Windows in the Human Interface Guidelines.

Topics

Essentials

Creating windows

Styling the associated toolbar

Opening windows

Closing windows

Sizing a window

Positioning a window

Configuring window visibility

Managing window behavior

Interacting with volumes

Deprecated Types

See Also

App structure