DefaultToggleStyle

The default toggle style.

StructureiOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+DefaultToggleStyle in SwiftUI

Declaration

React
type DefaultToggleStyle = SwiftOpaque<'DefaultToggleStyle'>;
Swift
nonisolated struct DefaultToggleStyle

Overview

Use the ToggleStyle.automatic static variable to create this style:

Toggle("Enhance Sound", isOn: $isEnhanced)
    .toggleStyle(.automatic)

From Apple’s SwiftUI documentation. Code samples there are Swift.

See also

More in Styles.