init(type:primaryAction:)
Creates a new button with the specified type, registers the primary action event, and sets the title and image to the action’s title and image.
Declaration
@MainActor @preconcurrency convenience init(type buttonType: UIButton.ButtonType = .system, primaryAction: UIAction?)Parameters
- buttonType:
The type of button.
- primaryAction:
The action to perform when the button is selected. The button registers this action for the Primaryactiontriggered control event and sets the title and image properties to the action’s title and image.