Initializer

init(role:action:label:)

Creates a button with a specified role that displays a custom label.

Declaration 宣言

init(role: ButtonRole?, action: @escaping () -> Void, label: () -> Label)
Available when Label conforms to View. LabelViewに準拠する場合に利用可能です。

Parameters パラメータ

role

An optional semantic role that describes the button. A value of nil means that the button doesn’t have an assigned role.

action

The action to perform when the user interacts with the button.

label

A view that describes the purpose of the button’s action. あるビュー、それはボタンのもつactionの目的を記述します。

See Also 参照

Creating a Button with a Role