Contents

init(configuration:primaryAction:)

Creates a new button with the specified configuration and registers the primary action event.

Declaration

@MainActor @preconcurrency convenience init(configuration: UIButton.Configuration, primaryAction: UIAction? = nil)

Parameters

  • configuration:

    The button configuration.

  • primaryAction:

    The action to perform for the Primaryactiontriggered control event.

Discussion

If the primary action contains a title or an image, this method copies them to the configuration and the button displays them.

See Also

Creating buttons from a configuration object