Alert

A model and native presentation modifier for alerts and confirmation dialogs.

A model and native presentation modifier for alerts and confirmation dialogs.

Public API

  • FAlert
  • FAlertAction
  • FAlertText
  • FAlertPresentation
  • FAlertInput

Example

Button("Delete") {
    alert = FAlert(
        title: "Delete workout?",
        message: "This action cannot be undone.",
        actions: [
            FAlertAction("Cancel", role: .cancel) {},
            FAlertAction("Delete", role: .destructive) {
                deleteWorkout()
            }
        ]
    )
}
.fAlert(item: $alert)

Source

This reference follows Sources/FreakUI/Components/Feedback/FAlert.swift. Component-specific configuration is documented under the public initializer, modifier, and supporting types in that source file.