Skip to content

nikitabelosludtcev/ActivationToggle

Repository files navigation

ActivationToggle Swift 5.0 Cocoapods Compatible

Sample

Toggle control that transforms to checkmark on activation.

Installation

ActivationToggle requires iOS 8.0 or later.

Using CocoaPods

  1. Add the pod ActivationToggle to your Podfile.

pod 'ActivationToggle'

  1. Run pod install from Terminal, then open your app's .xcworkspace file to launch Xcode.

Manual

Drag ActivationToggle.swift file to your project sources.

Basic Usage

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)
}

Demo

Build and run the ActivationToggle-Example project in Xcode to see ActivationToggle in action.

TODOs

  • Add swipe gesture handling and animations

Communication

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Contact

Nikita Belosludtcev

License

This project is available under the Apache License, version 2.0. See the LICENSE file for more info.

About

A control that offers a binary choice, such as On/Off.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published