ConfirmationAlertViewModel
public struct ConfirmationAlertViewModel
ConfirmationAlertViewModel models a UIAlertController that can be confirmed or dismissed.
-
The alert title.
Declaration
Swift
public let title: String? -
The alert message.
Declaration
Swift
public let message: String? -
The dismiss button title.
Declaration
Swift
public let dismissButtonTitle: String -
The confirm button title.
Declaration
Swift
public let confirmButtonTitle: String -
The dismiss button action.
Declaration
Swift
public let dismissAction: (ConfirmationAlertViewModel) -> Void -
The confirm button action.
Declaration
Swift
public let confirmAction: (ConfirmationAlertViewModel) -> Void -
Initialize a new ConfirmationAlertViewModel with the provided parameters.
Declaration
Swift
public init( title: String? = "", message: String? = .none, dismissButtonTitle: String = DefaultDismissButtonTitleKey.localized(), dismissAction: @escaping (ConfirmationAlertViewModel) -> Void = { _ in }, confirmButtonTitle: String = DefaultConfirmButtonTitleKey.localized(), confirmAction: @escaping (ConfirmationAlertViewModel) -> Void = { _ in })Parameters
titleThe alert title.
messageThe alert message.
dismissButtonTitleThe dismiss button title.
dismissActionThe dismiss button action.
confirmButtonTitleThe confirm button title.
confirmActionThe confirm button action.
-
Default title key for confirm button. It will fetch the localized value from the Localizable.strings file in the main bundle. So you’ll have to add this key and give it a value in your Localizable.strings file. You can provide a different key by changing this property.
Seealso
Localizable.StringDeclaration
Swift
public static var DefaultConfirmButtonTitleKey: String -
Default title key for dismiss button. It will fetch the localized value from the Localizable.strings file in the main bundle. So you’ll have to add this key and give it a value in your Localizable.strings file. You can provide a different key by changing this property.
Seealso
Localizable.StringDeclaration
Swift
public static var DefaultDismissButtonTitleKey: String
ConfirmationAlertViewModel Structure Reference