Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/BalestraPatrick/SquishButton
A button that squishes when pressed. As seen in the Clips app.
https://github.com/BalestraPatrick/SquishButton
button swift uikit xcode
Last synced: about 1 month ago
JSON representation
A button that squishes when pressed. As seen in the Clips app.
- Host: GitHub
- URL: https://github.com/BalestraPatrick/SquishButton
- Owner: BalestraPatrick
- License: mit
- Created: 2017-04-08T17:03:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-08T21:26:18.000Z (almost 7 years ago)
- Last Synced: 2024-11-09T19:23:42.582Z (about 1 month ago)
- Topics: button, swift, uikit, xcode
- Language: Swift
- Size: 704 KB
- Stars: 396
- Watchers: 8
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-cocoa - SquishButton
README
Inspired by the new [Clips app](http://www.apple.com/lae/clips/) record button, `SquishButton` is a `UIButton` subclass that implements the same design and behavior.
## Usage
Use it as every other `UIButton` object and customize it to suit your needs. These are the public properties that `SquishButton` adds:```swift
/// The number of pixels to scale the inner rectangle.
open var scaling = CGFloat(10)/// The duration of the animation when the button is in the highlighted state.
open var animationDuration = 0.15/// The color of the inner rectangle.
open var color = UIColor(red: 244.0/255.0, green: 51.0/255.0, blue: 50.0/255.0, alpha: 1.0)/// The inset between the outer border and inner rectangle.
open var innerInset = CGFloat(5)
```## Requirements
iOS 8.3 and Swift 3.2.If you are using Swift 4, please use the [swift4 branch](https://github.com/BalestraPatrick/SquishButton/tree/swift4).
## Installation
SquishButton is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod 'SquishButton'
```You can also use [Carthage](https://github.com/Carthage/Carthage) if you prefer. Add this line to your `Cartfile`.
```ruby
github "BalestraPatrick/SquishButton"
```## Author
I'm [Patrick Balestra](http://www.patrickbalestra.com).
Email: [[email protected]](mailto:[email protected])
Twitter: [@BalestraPatrick](http://twitter.com/BalestraPatrick).## License
`SquishButton` is available under the MIT license. See the [LICENSE](LICENSE) file for more info.