init(role: ButtonRole ?, action: () -> Void, label: () -> Label)
Creates a button with a specified role that displays a custom label.
Available when
Label
conforms to View
.
Label
がView
に準拠する場合に利用可能です。
init(LocalizedStringKey , role: ButtonRole ?, action: () -> Void)
Creates a button with a specified role that generates its label from a localized string key.
Available when
Label
is Text
.
Label
がText
である時に利用可能です。
struct ButtonRole
A value that describes the purpose of a button.