init(_:isPresented:presenting:actions:message:)
Creates an alert scene, using the given data to produce the alert’s content with a title, a set of actions, and a message. Note that this creates a text view on your behalf.
Declaration
nonisolated init<S, T>(_ title: S, isPresented: Binding<Bool>, presenting data: T?, @ContentBuilder actions: (T) -> Actions, @ContentBuilder message: (T) -> Message) where S : StringProtocolParameters
- title:
A text string used as the title of the alert.
- isPresented:
A binding to a Boolean value that determines whether to present the alert. When someone presses or taps one of the alert’s actions, the system sets this value to
falseand dismisses. - data:
A source of truth that is passed to the alert to populate the message and actions.
- actions:
A Contentbuilder returning the actions for the dialog.
- message:
A Contentbuilder returning the message for the dialog.