ConfirmationDialogConfiguration
public struct ConfirmationDialogConfiguration
The configuration for customizing the confirmation dialog shown when
cancelling a ListPickerDestination with unsaved selections.
-
The title text displayed in the confirmation dialog.
Declaration
Swift
public let title: String -
An optional closure called when the user taps cancel and there are unsaved changes, but the dialog is disabled. Invoked before the view is dismissed.
Declaration
Swift
public var discardAction: (() -> Void)? -
When
true, the confirmation dialog is completely suppressed and tapping cancel always dismisses immediately, discarding changes.Declaration
Swift
public let isDialogDisabled: Bool -
Creates a confirmation dialog configuration with custom actions.
Declaration
Swift
public init( title: String = "Are you sure you want to discard your selections?".localizedFioriString(), isDialogDisabled: Bool = false, discardAction: (() -> Void)? = nil, @ViewBuilder actions: @escaping (_ dismiss: DismissAction) -> some View )Parameters
titleThe dialog title. Defaults to the SDK’s localized “Are you sure you want to discard your selections?” string.
isDialogDisabledWhen
true, the dialog is never shown and cancel always dismisses immediately. Defaults tofalse.discardActionAn optional closure invoked before dismiss when the dialog is disabled and the user taps cancel with unsaved changes.
actionsA
@ViewBuilderclosure that receives adismissaction and returns the dialog’s action buttons. UseButtonwith roles like.destructiveor.cancelto control styling. -
Creates a confirmation dialog configuration with default action labels.
Declaration
Swift
public init( title: String = "Are you sure you want to discard your selections?".localizedFioriString(), isDialogDisabled: Bool = false, discardAction: (() -> Void)? = nil )Parameters
titleThe dialog title.
isDialogDisabledWhen
true, the dialog is never shown.discardActionAn optional closure invoked before dismiss when the dialog is disabled and the user taps cancel with unsaved changes.
-
A convenience configuration that disables the confirmation dialog entirely.
Declaration
Swift
public static let disabled: ConfirmationDialogConfiguration