Skip to content

A more customizable replica of UISwitch by Apple

License

Notifications You must be signed in to change notification settings

baianat/UISwitchy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UISwitchy

A more customizable, powerful replica for Apple standard UISwtich.

Quick Start

Customization

Callback

Installation

Quick Start:

1- Drag View object from the Object Library into your storyboard.

2- Set the view's class to UISwitchy in the Identity Inspector. Set its module property to UISwitchy.

3- Add import UISwitchy to the header of your view controller.

4- Create an outlet in the corresponding view controller.

@IBOutlet weak var uiswitchy: UISwitchy!

Customization:

You can customize UISwitchy for these attributes:

Attribute Definition
buttonFillColorOn color of inner circle while switch is on
buttonFillColorOff color of inner circle while switch is off
backgroundColorOn background color of the switch while is on
backgroundColorOff background color of the switch while is off
buttonImageOn the icon of the switch while is on
buttonImageOff the icon of the switch while is off
imageTintingColorOn the icon tinting color of the switch while is on
imageTintingColorOff the icon tinting color of the switch while is off
borderColor border color of the switch
borderWidth border width of the switch

Callback:

Just as the normal ios, you can listen for the state change of the switch via an IBAction

Installation

To install it, simply add the following line to your Podfile:

pod 'UISwitchy'

License

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