Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/suzuki-0000/AnimatablePlayButton
Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation.
https://github.com/suzuki-0000/AnimatablePlayButton
Last synced: 3 months ago
JSON representation
Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation.
- Host: GitHub
- URL: https://github.com/suzuki-0000/AnimatablePlayButton
- Owner: suzuki-0000
- License: mit
- Created: 2015-12-14T12:23:24.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2020-03-29T16:53:40.000Z (over 4 years ago)
- Last Synced: 2024-08-05T22:28:30.734Z (3 months ago)
- Language: Swift
- Homepage:
- Size: 37.1 KB
- Stars: 80
- Watchers: 3
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - AnimatablePlayButton - Animated Play and Pause Button using CALayer, CAKeyframeAnimation. (UI / Button)
- awesome-cocoa - AnimatablePlayButton
- awesome-ios-star - AnimatablePlayButton - Animated Play and Pause Button using CALayer, CAKeyframeAnimation. (UI / Button)
- awesome-swift-cn - AnimatablePlayButton - Animated Play and Pause Button using CALayer, CAKeyframeAnimation. (Libs / UI)
README
AnimatablePlayButton
========================[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/AnimatablePlayButton.svg?style=flat)](http://cocoadocs.org/docsets/AnimatablePlayButton)
[![Swift 2.0](https://img.shields.io/badge/Swift-2.0-orange.svg?style=flat)](https://developer.apple.com/swift/)Animated Play and Pause Button written in Swift, using CALayer, CAKeyframeAnimation.
![sample](Screenshots/example01.gif)
## 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:```ogdl
github "suzuki-0000/AnimatablePlayButton"
```## How to use
#### 1. Create a button, specify backgroundColor of Button(bgColor), and button color(color).
```swift
let button = AnimatablePlayButton(frame: CGRectMake(0, 0, 44, 44))
button.bgColor = .blackColor()
button.color = .whiteColor()
self.view.addSubview(button)
```#### 2. Add tapped function
```swift
button.addTarget(self, action: Selector("tapped:"), forControlEvents: .TouchUpInside)
```
```swift
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.