AdmiralSwiftUI Controls Switch - admiral-team/admiralui-ios GitHub Wiki
Overview
CustomSwitch
- A custom control that toggles between on and off states.
To configure the current toggle style for a view hierarchy, use the toggleStyle(_:) modifier.
You can create CustomSwitch in the Default, Active states..
Code
@State private var isOn: Bool = true
CustomSwitch(isOn: $isCustomSwitchOn)
.disabled(false)
CustomSwitch(isOn: $isCustomSwitchOn)
You can create a CustomSwitch
by specifying the following parameters in the initializer
Initializer parameters:
- isOn - Bool - Enabled/Disabled flag
Live Example
To run live demo with CustomSwitch
open Xcode and run project with Example target. Then in the main page -> Switcher:
Contribution
You can help us to find bugs or ask us to add features.
- To start
issue
please use ready-made templates. - To make changes to the repository, you need to create a
fork
of the project, make changes to the code and create apull request
in our project. You can read more about this in the Github documentation.