Skip to content
/ Switch Public

💊 An iOS switch control implemented in Swift with full Interface Builder support

License

Notifications You must be signed in to change notification settings

T-Pham/Switch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Switch

GitHub issues Documentation

GitHub release Platform License

Carthage

CocoaPods CocoaPods downloads

Description

An iOS switch control implemented in Swift with full Interface Builder support.

To run the demo project:

pod try RoundedSwitch

Switch

Switch

Usage

Either config the switch in the Interface Builder or programatically as follow:

let mySwitch = Switch()
mySwitch.leftText = "Windows"
mySwitch.rightText = "Mac"
mySwitch.rightSelected = true
mySwitch.tintColor = UIColor.purpleColor()
mySwitch.disabledColor = mySwitch.tintColor.colorWithAlphaComponent(0.2)
mySwitch.sizeToFit()
mySwitch.addTarget(self, action: #selector(ViewController.switchDidChangeValue(_:)), forControlEvents: .ValueChanged)

Installation

Add the line below to your Cartfile:

github "T-Pham/Switch"

Add the line below to your Podfile:

pod 'RoundedSwitch'

Manually

Add the file Switch.swift to your project. You are all set.

License

Switch is available under the MIT license. See the LICENSE file for more info.