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 then 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.

To learn how to create the structure that enables users to navigate among the parts of your app, see Presentation Containers.

Topics 話題

Alerts

Alerts with a Message

Confirmation Dialogs

Confirmation Dialogs with a Message

Sheets

Popovers

Sheet and Popover Dismissal

File Managers

Quick Look Previews

Apple Music

See Also 参照

Providing Interactivity 相互作用性を提供する