Contents

Presentation modifiers

Define additional views for the view to present under specified conditions.

Overview

Use presentation modifiers to show different kinds of modal presentations, like alerts, popovers, sheets, and confirmation dialogs.

Because SwiftUI is a declarative framework, you don’t call a method at the moment you want to present the modal. Rather, you define how the presentation looks and the condition under which SwiftUI should present it. SwiftUI detects when the condition changes and makes the presentation for you. Because you provide a Binding to the condition that initiates the presentation, SwiftUI can reset the underlying value when the user dismisses the presentation.

For more information about how to use these modifiers, see Modal presentations.

Topics

Alerts

Alerts with a message

Confirmation dialogs

Confirmation dialogs with a message

Dialog configuration

Sheets

Popovers

Sheet and popover configuration

File exporter

File importer

File mover

File dialog configuration

Inspectors

Quick look previews

Family Sharing

Live Activities

Apple Music

StoreKit

PhotoKit

Translation

See Also

Providing interactivity