Protocol

PrimitiveButtonStyle

A type that applies custom interaction behavior and a custom appearance to all buttons within a view hierarchy.

Declaration

protocol PrimitiveButtonStyle

Overview

To configure the current button style for a view hierarchy, use the buttonStyle(_:) modifier. Specify a style that conforms to PrimitiveButtonStyle to create a button with custom interaction behavior. To create a button with the standard button interaction behavior defined for each platform, use ButtonStyle instead.

Topics

Implementing Buttons

func makeBody(configuration: Self.Configuration) -> Self.Body

Creates a view that represents the body of a button.

Required.

struct PrimitiveButtonStyleConfiguration

The properties of a button.

Identifying Buttons

associatedtype Body

A view that represents the body of a button.

Required.

See Also

Applying Custom Button Styles

protocol ButtonStyle

A type that applies standard interaction behavior and a custom appearance to all buttons within a view hierarchy.