Button

public struct Button

A button representing an operation of an alert presentation.

  • Creates an Alert.Button with the default style.

    Declaration

    Swift

    public static func `default`(_ label: Text, action: (() -> Void)? = {}) -> Alert.Button
  • Creates an Alert.Button that indicates cancellation of some operation.

    Declaration

    Swift

    public static func cancel(_ label: Text, action: (() -> Void)? = {}) -> Alert.Button
  • Creates an Alert.Button with a style indicating destruction of some data.

    Declaration

    Swift

    public static func destructive(_ label: Text, action: (() -> Void)? = {}) -> Alert.Button