OCSwitch - Custom SwiftUI Switch Component
OCSwitch is a custom SwiftUI toggle component that enables you to create simple toggle with different states. This README will guide you through using and integrating the OCSwitch component into your SwiftUI projects.
Features
- Create switch with active, inactive, selected and deselected states.
Installation
- Copy the
OCSwitchstruct code from [OCSwitch.swift] and related Utils and Add it in your project.
Usage
You can create an instance of OCSwitch by initializing it with the below parameters. Here's an example of how to create a switch which is active and selected:
OCSwitch(isOn: true, isEnabled: true) { _ in
}