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 a LocalizedError

    This to avoid an error: Protocol ‘LocalizedError’ as a type cannot conform to the protocol itself

    See more

    Declaration

    Swift

    struct LocalizedAlertError: LocalizedError
  • Create a custom LocalizedError

    Note

    This is to wrap a NSError into the modern world
    See more

    Declaration

    Swift

    struct LocalizedAlertCustomError: LocalizedError
  • SwiftUI View with the confirmation button

    See more

    Declaration

    Swift

    struct ConfirmButton: View