Contents

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 nil means that the button doesn’t have an assigned role.

  • intent:

    The AppIntent to execute.

  • label:

    A view that describes the purpose of the button’s action.

See Also

Creating a button to perform an App Intent