Latest 0.1.1
License MIT
Platforms ios 10.0


A custom UIControl class to use as UISwitch from Storyboards or Code.

Why CustomUISwitch

Hi! Recently i got some mockups for a new iOS from our ninja at Orfium ( whose identity shall be kept hidden.

One of the screens contained a custom UISwitch, this was one of the first things that i started to work on ;)

What you get

Custom UISwitch

How to Install

There is two ways to install this library


  • Simply drag ‘n drop the CustomSwitch.swift file to your project
  • Download the Assets folder and add them to your project


Add to your podfile

pod 'CustomSwitch', '~> 0.1'

How to use


  • Add a UIView to a UIViewController and change the class to CustomSwitch, done! Some properties are exposed for the user to change them.


  • Create a CustomSwitch via code:
    let myCustomSwitch = CustomSwitch(frame: CGRect(x: 50, y: 50, width: 48, height: 14))
  • Get Switch value (on/off):
    myCustomSwitch.isOn { (value) in

Available Properties

  • animationDuration: Double
  • isOn: Bool
  • isOnImage: String
  • isOffImage: String
  • onTintColor: UIColor
  • offTintColor: UIColor
  • padding: CGFloat
  • thumbOnTintColor: UIColor
  • thumbOffTintColor: UIColor
  • thumbTintColor: UIColor

Latest podspec

    "name": "CustomSwitch",
    "version": "0.1.1",
    "summary": "A custom UISwitch.",
    "swift_version": "4.0",
    "description": "A custom UIControl class to use as UISwitch from Storyboards or Code.",
    "homepage": "",
    "screenshots": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Dimitrios Kalaitzidis": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.1.1"
    "social_media_url": "",
    "platforms": {
        "ios": "10.0"
    "source_files": "CustomSwitch/Classes/**/*",
    "resource_bundles": {
        "CustomSwitch": [

Pin It on Pinterest

Share This