BPKSwitch
public struct BPKSwitch<Content> : View where Content : View
A control that toggles between on and off states.
You create a switch by providing an isOn binding and a label. Bind isOn
to a Boolean property that determines whether the switch is on or off. Set
the label to a view that visually describes the purpose of switching between
toggle states
-
Creates a switch that generates its label from a string.
This initializer creates a
BPKTextview on your behalf, and treats the title similar toBPKText/init(_:).Declaration
Swift
public init(isOn: Binding<Bool>, text: String) where Content == BPKTextParameters
isOnA binding to a property that indicates whether the switch is on or off.
textA string that describes the purpose of the switch.
-
Creates a switch that displays a custom label.
Declaration
Swift
public init(isOn: Binding<Bool>, @ViewBuilder content: () -> Content)Parameters
isOnA binding to a property that determines whether the switch is on or off.
contentA view that describes the purpose of the switch.
-
Declaration
Swift
public var body: some View { get }