AlertMessage
public struct AlertMessage
The structure for an Alert Message
-
Init the alert message
Declaration
Swift
public init(error: Error, role: ButtonRole? = nil, action: (() -> Void)? = nil)
Parameters
error
The
Error
role
The optional role of the confirm
Button
action
The optional action of the confirm
Button
-
The
Error
Declaration
Swift
let error: Error
-
The role of the button
Declaration
Swift
let role: ButtonRole?
-
The action for the button
Declaration
Swift
let action: (() -> Void)?
-
Wrap an
Error
into aLocalizedError
This to avoid an error: Protocol ‘LocalizedError’ as a type cannot conform to the protocol itself
See moreDeclaration
Swift
struct LocalizedAlertError: LocalizedError
-
Declaration
Swift
struct LocalizedAlertCustomError: LocalizedError
-
SwiftUI
See moreView
with the confirmation buttonDeclaration
Swift
struct ConfirmButton: View