https://github.com/inaka/fadebutton
Fading effects for UIButtons made simple
https://github.com/inaka/fadebutton
fadebutton fading-effects ios swift uibutton
Last synced: 10 months ago
JSON representation
Fading effects for UIButtons made simple
- Host: GitHub
- URL: https://github.com/inaka/fadebutton
- Owner: inaka
- License: apache-2.0
- Created: 2014-07-14T15:09:51.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2020-04-09T09:30:23.000Z (about 6 years ago)
- Last Synced: 2025-08-23T11:39:40.200Z (10 months ago)
- Topics: fadebutton, fading-effects, ios, swift, uibutton
- Language: Swift
- Homepage:
- Size: 418 KB
- Stars: 15
- Watchers: 46
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
FadeButton
============
***Fading effects for UIButtons made simple***
[](https://travis-ci.org/inaka/FadeButton) [](https://swift.org/) [](https://cocoapods.org/pods/FadeButton) [](http://twitter.com/inaka)
Overview
--------
This is just a customizable `UIButton` subclass that provides fading effects that display upon touch:

> Effects occur when the user releases the button.
Usage
-----
**1)** Go to interface builder, select your button, open the Identity Inspector tab, and set `FadeButton` as custom class.

**2)** Check out the following attributes in the Attributes Inspector tab:

- `fadeDuration` configures how long the fading effect will last.
- Then, the properties `textColor`, `image` and `backgroundImage` (that can have different values set for each state config) will be affected by the fading effect when the transitions between the `.highlighted` state and the `.normal` state occur.
- For instance, if you set `textColor: .white for: .normal` state and `textColor: .yellow for: .highlighted` state, the user will see a fading text effect from yellow to white after releasing the button.
Sample Project
-------
There's a sample project inside this repo that you can check out in order to have a deeper understanding of the usage of this library.
## Setup
- Via [cocoapods](http://cocoapods.org/), add this line to your `Podfile`:
- `pod 'FadeButton', '~> 2.0'`
- Otherwise, you can just drag and drop the `FadeButton.swift` file into your project, and keep it up to date by yourself.
## Older Versions Support
- As of its [2.0.0](https://github.com/inaka/FadeButton/releases/tag/2.0.0) release, this library works with [**Swift 3.0**](https://swift.org/blog/swift-3-0-released/)
- If you look for older languages version support, you can check out the [1.0.0](https://github.com/inaka/FadeButton/releases/tag/1.0.0) release, that contains the old Objective-C version of the library, which is compatible with older Swift versions.
## Contact Us
For **questions** or **general comments** regarding the use of this library, please use our public [hipchat room](http://inaka.net/hipchat).
If you find any **bug**, a **problem** while using this library, or have **suggestions** that can make it better, please [open an issue](https://github.com/inaka/FadeButton/issues/new) in this repo (or a pull request).
You can also check all of our open-source projects at [inaka.github.io](https://inaka.github.io).