init(role:intent:label:)
Creates a button with a specified role that performs an AppIntent.
Declaration
nonisolated init(role: ButtonRole?, intent: some AppIntent, @ViewBuilder label: () -> Label)Parameters
- role:
An optional semantic role describing the button. A value of
nilmeans that the button doesn’t have an assigned role. - intent:
The
AppIntentto execute. - label:
A view that describes the purpose of the button’s
action.