Latest 1.0.0
Homepage https://github.com/remirobert/Suitchi
License MIT
Authors

Platform
Language
License
Issues

Suitchi is a custom switch for iOS written in swift. Suitchi is highly customizable, you can change almost all parts of this composant. It can display a label in the center of the switch to display some additional information. Suitchi handles gesture and simple click.

Customize as you wish.

Installation

CocoaPods

pod 'Suitchi'

Or just copy the Sources/Suitchi.swift file in your project.

How it works ?

To make your life easier and make your most beautiful and maintainable code, Suitchi uses blocks to retrieve the events.

let genderSwitch = Suitchi(frame: CGRectMake(0, 0, 300, 100),
  onSwitchedBlock: { () -> () in
    println("On !")
  }) { () -> () in
    println("Off !")
}

Get the current state, or change it:

if genderSwitch.on {
}

genderSwitch.switchOn()
genderSwitch.switchOff()

Some customisation:

genderSwitch.offLabel = "Man"
genderSwitch.onLabel = "Woman"

genderSwitch.onColor = UIColor(red:1, green:0.15, blue:0.29, alpha:1)
genderSwitch.offColor =  UIColor(red:0.3, green:0.3, blue:0.82, alpha:1)

genderSwitch.centerText = "gender"

Latest podspec

{
    "name": "Suitchi",
    "version": "1.0.0",
    "summary": "Custom Switch for iOS.",
    "description": "  Suitchi is a custom switch for iOS written in swift.n   Suitchi is highly customizable, you can change almost all parts of this composant.n    It can display a label in the center of the switch to display some additional information.n     Suitchi handles gesture and simple click.n",
    "homepage": "https://github.com/remirobert/Suitchi",
    "license": "MIT",
    "authors": {
        "remirobert": "[email protected]"
    },
    "source": {
        "git": "https://github.com/remirobert/Suitchi.git",
        "tag": "1.0.0"
    },
    "source_files": "Sources/Suitchi.swift"
}

Pin It on Pinterest

Share This