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
issueplease use ready-made templates. - To make changes to the repository, you need to create a
forkof the project, make changes to the code and create apull requestin our project. You can read more about this in the Github documentation.