Button

public struct Button<Label> : View where Label : View

A control that performs an action when triggered.

  • Declaration

    Swift

    public var body: some View { get }
  • Creates an instance with a custom view as label.

    Declaration

    Swift

    public init(action: @escaping () -> Void, @ViewBuilder label: () -> Label)

Available where Label == Text

  • Creates an instance with a string as label.

    Declaration

    Swift

    init<S>(_ title: S, action: @escaping () -> Void) where S : StringProtocol