-
Notifications
You must be signed in to change notification settings - Fork 30
Toggles
Nick Sarno edited this page Apr 14, 2022
·
1 revision
Highly customizable Toggle.
@State private var isOn: Bool = false
var body: some View {
CustomToggle(isOn: $isOn)
}
Customize with optional parameters.
CustomToggle(isOn: $isOn, width: 100, pinColor: .gray, backgroundColor: .black, haptic: .selection)
Easily animate colors.
CustomToggle(isOn: $isOn, pinColor: .white, backgroundColor: isOn ? .green : .gray.opacity(0.3))
CustomToggle(isOn: $isOn, pinColor: isOn ? .red : .white, backgroundColor: isOn ? .blue : .gray.opacity(0.3))