Latest 0.0.3
Homepage https://github.com/finngaida/DayNightSwitch
License MIT
Platforms ios 9.0
Authors

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

MIT.

Latest podspec

{
    "name": "DayNightSwitch",
    "version": "0.0.3",
    "summary": "Add a more natural design to your switches, Moon / Sun for off / on.",
    "description": "I saw a [Dribbble Shot](https://dribbble.com/shots/1909289-Day-Night-Toggle-Button-GIF) and thought it was cute, so here's the Swift version of it. A custom UIView subclass that acts like a switch and calls a closure upon change.",
    "homepage": "https://github.com/finngaida/DayNightSwitch",
    "license": "MIT",
    "authors": {
        "Finn Gaida": "[email protected]"
    },
    "social_media_url": "https://twitter.com/fga",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/finngaida/DayNightSwitch.git",
        "tag": "0.0.3"
    },
    "source_files": "DayNightSwitch.swift",
    "resources": "Example/Assets.xcassets/cloud.imageset/[email protected]"
}

Pin It on Pinterest

Share This