One Logo Pool Ball
SwiftUI · IOS API REFERENCE

SwitchToggleStyle

struct · iOS 13.0+ · SDK 27.1

nonisolated struct SwitchToggleStyle

A toggle style that displays a leading label and a trailing switch. Use the ``ToggleStyle/switch`` static variable to create this style: Toggle("Enhance Sound", isOn: $isEnhanced) .toggleStyle(.switch)

Members (2)

init · iOS 14.0+ · Deprecated in iOS 100000.0

init

TypeScript
static initTint(tint: _SwiftUICore_Color): SwitchToggleStyle
Swift declaration
nonisolated init(tint: Color)

Creates a switch style with a tint color.

init · iOS 13.0+

init

TypeScript
static init(): SwitchToggleStyle
Swift declaration
nonisolated init()

Creates a switch toggle style. Don't call this initializer directly. Instead, use the ``ToggleStyle/switch`` static variable to create this style: Toggle("Enhance Sound", isOn: $isEnhanced) .toggleStyle(.switch)

Skipped declarations

1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

SwitchToggleStyle.makeBody(configuration:)

This protocol needs associated types that cannot yet cross the bridge.

All SwiftUI types →