Contents

confirmationDialog(_:item:titleVisibility:actions:message:)

Presents a confirmation dialog with a message using data to produce the dialog’s content and a text view for the message.

Declaration

nonisolated func confirmationDialog<A, M, T>(_ title: Text, item data: Binding<T?>, titleVisibility: Visibility = .automatic, @ContentBuilder actions: (T) -> A, @ContentBuilder message: (T) -> M) -> some View where A : View, M : View

Parameters

  • title:

    The title of the dialog.

  • data:

    A binding to optional source of truth for the confirmation dialog. The system presents the dialog when the binding’s value is non-nil. When the user presses or taps the dialog’s default action button, the system sets this value to nil and dismisses. The system passes the contents to the modifier’s closures. You use this data to populate the fields of a confirmation dialog that you create that the system displays to the user.

  • titleVisibility:

    The visibility of the dialog’s title. The default value is Automatic.

  • actions:

    A Contentbuilder returning the dialog’s actions given the currently available data.

  • message:

    A Contentbuilder returning the message for the dialog given the currently available data.

See Also

Confirmation dialogs with a message