init(_:isPresented:presenting:actions:)
Creates an alert scene, using the given data to produce the alert’s content with a title, and a set of actions. Note that this creates a text view on your behalf.
Declaration
@export(implementation) nonisolated init<T>(_ titleResource: LocalizedStringResource, isPresented: Binding<Bool>, presenting data: T?, @ContentBuilder actions: (T) -> Actions) where Message == EmptyViewParameters
- titleResource:
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.