GithubHelp home page GithubHelp logo

nathanwalker / animatableplaybutton Goto Github PK

View Code? Open in Web Editor NEW

This project forked from suzuki-0000/animatableplaybutton

0.0 3.0 0.0 41 KB

Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation.

License: MIT License

Ruby 4.05% Objective-C 3.66% Swift 92.28%

animatableplaybutton's Introduction

AnimatablePlayButton

Carthage Compatible CocoaPods Compatible Swift 2.0

Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation.

sample

features

  • Only using CAShapeLayer, CAKeyframeAnimation. not from image object.

Requirements

  • iOS 8.0+
  • Swift 2.0+
  • ARC

##Installation

####CocoaPods available on CocoaPods. Just add the following to your project Podfile:

pod 'AnimatablePlayButton'
use_frameworks!

####Carthage To integrate into your Xcode project using Carthage, specify it in your Cartfile:

github "suzuki-0000/AnimatablePlayButton"

How to use

1. Create a button, specify backgroundColor of Button(bgColor), and button color(color).

let button = AnimatablePlayButton(frame: CGRectMake(0, 0, 44, 44))
button.bgColor = .blackColor()
button.color = .whiteColor()
self.view.addSubview(button)

2. Add tapped function

button.addTarget(self, action: Selector("tapped:"), forControlEvents: .TouchUpInside)
func tapped(sender: AnimatablePlayButton) {
    if sender.selected {
        sender.deselect()
    } else {
        sender.select()
    }
}

License

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

animatableplaybutton's People

Contributors

nathanwalker avatar readmecritic avatar suzuki-0000 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.