A control that offers a binary choice, such as On/Off.
Toggle control that transforms to checkmark on activation.
ActivationToggle requires iOS 8.0 or later.
ActivationToggle
to your Podfile.pod 'ActivationToggle'
pod install
from Terminal, then open your app's .xcworkspace
file to launch Xcode.Drag ActivationToggle.swift file to your project sources.
Import the module.
import ActivationToggle
Just create a toggle and configure it
override func viewDidLoad() {
super.viewDidLoad()
let toggle = ActivationToggle()
toggle.onColor = UIColor.purple
toggle.offColor = UIColor.darkGray
toggle.toggleColor = UIColor.green
toggle(self, action: #selector(valueChanged(control:)), for: .valueChanged)
view.addSubview(toggle)
}
Build and run the ActivationToggle-Example
project in Xcode to see ActivationToggle
in action.
Nikita Belosludtcev
This project is available under the Apache License, version 2.0. See the LICENSE file for more info.