LucioLee / DayNightSwitch

Dribbble inspired switch for day and night status

Home Page:https://dribbble.com/shots/1909289-Day-Night-Toggle-Button-GIF

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DayNightSwitch

So I came across this awesome, kinda skeuomorphic-ish custom switch design on Dribbble and thought it was cute, so here you go: gif

Installation

CocoaPods

  1. Add pod 'DayNightSwitch to your Podfile
  2. Run pod install

Manual

  1. Clone or download the repo, drop the DayNightSwitch.swift file in your project and
  2. Either drop a UIView into your storyboard and set its class to DayNightButton or create an instance of the switch like so:

Usage

    let dayNightSwitch = DayNightSwitch(center: self.view.center)
    dayNightSwitch.changeAction = { on in
        print("The switch is now " + (on ? "on" : "off"))
    }
    self.view.addSubview(dayNightSwitch)

License

Original credit for the design goes to Ramakrishna and for the animations to Tsuriel MIT.

About

Dribbble inspired switch for day and night status

https://dribbble.com/shots/1909289-Day-Night-Toggle-Button-GIF

License:MIT License


Languages

Language:Objective-C 52.9%Language:Swift 29.2%Language:Ruby 11.5%Language:Logos 5.0%Language:Makefile 1.4%