Protocol

ToggleStyle

A type that specifies the appearance and interaction of all toggles within a view hierarchy.

Declaration

protocol ToggleStyle

Overview

To configure the current toggle style for a view hiearchy, use the toggleStyle(_:) modifier.

Topics

Configuring the Toggle Style

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

Creates a view that represents the body of a toggle.

Required.

typealias ToggleStyle.Configuration

The properties of a toggle instance.

struct ToggleStyleConfiguration

The properties of a toggle instance.

Getting the View

associatedtype Body

A view that represents the appearance and interaction of a toggle.

Required.

See Also

Styling a Toggle

struct DefaultToggleStyle

The default toggle style.

struct SwitchToggleStyle

A toggle style that displays a leading label and a trailing switch.

struct CheckboxToggleStyle

A toggle style that displays a checkbox followed by its label.

func toggleStyle<S>(S) -> View

Sets the style for toggles within this view.