paper-switch 0,1,3,0,0,-1,2,0 travis-ci CocoaPods

RAMPaperSwitch is a Swift module which paints over the parent view when the switch is turned on.

header

RAMPaperSwitch

CocoaPods CocoaPods CocoaPods Carthage compatible Twitter Travis Analytics

About

This project is maintained by Ramotion, Inc.
We specialize in the designing and coding of custom UI for Mobile Apps and Websites.

Looking for developers for your project?

Screenshot

PaperSwitch

The iPhone mockup available here.

Try this UI control in action

Requirements

  • iOS 8.0+
  • Xcode 6.1

Installation

Just add the RAMPaperSwitch folder to your project.

or use CocoaPods with Podfile:

pod 'RAMPaperSwitch', '~> 2.0.4' 

or Carthage users can simply add to their Cartfile:

github "Ramotion/paper-switch"

Usage

RAMPaperSwitch is a drop-in replacement of UISwitch. You just need to set the onTintColor property of the switch, and it will automatically paint over its superview with the selected color. You have ability to set duration of animation instead of default value.

  1. Create a new UISwitch in your storyboard or nib.

  2. Set the class of the UISwitch to RAMPaperSwitch in your Storyboard or nib.

  3. Set onTintColor for the switch

  4. Set duration property programmatically if You want to change animation duration.

  5. Add animation for other views near the switch if need.

Animate views

You can animate other views near the switch. For example, you can change color to views or labels that are inside the same superview. Duration of animation can be gotten from the RAMPaperSwitch's property duration. You can animate CoreAnimation properties like this:

self.paperSwitch.animationDidStartClosure = {(onAnimation: Bool) in
    UIView.transitionWithView(self.label, duration: self.paperSwitch.duration, options: UIViewAnimationOptions.TransitionCrossDissolve, animations: {
        self.label.textColor = onAnimation ? UIColor.whiteColor() : UIColor.blueColor()
    }, completion:nil)
}

Folow Us

Twitter URL Twitter Follow

Related Repositories

paper.js

paper.js

The Swiss Army Knife of Vector Graphics Scripting – Scriptographer ported to Jav ...

Quttons

Quttons

Buttons made of Quantum Paper ...

tensorflow-white-paper-notes

tensorflow-white-paper-notes

Annotated notes and summaries of the TensorFlow white paper, along with SVG figu ...

awesome-swift

awesome-swift

A curated list of awesome Swift frameworks, libraries and software. ...

ModelFit

ModelFit

This is the offline fitting portion of my paper: "Real-Time Continuous Pose Reco ...


Top Contributors

ober01 Juriv ooleynich Pakhaliuk aleksei1000000 devladinci RamotionRussell Eddpt kaphacius

Releases

-   2.0.0 zip tar
-   1.0.7 zip tar
-   1.0.6 zip tar
-   1.0.5 zip tar
-   1.0.4 zip tar
-   1.0.3 zip tar
-   1.0.2 zip tar
-   1.0.1 zip tar
-   1.0.0 zip tar
-   0.0.3 zip tar
-   0.0.2 zip tar
-   0.0.1 zip tar