Git Product home page Git Product logo

fadebutton's Introduction

FadeButton

Fading effects for UIButtons made simple

Build Status Swift Cocoapods Twitter

Overview

This is just a customizable UIButton subclass that provides fading effects that display upon touch:

Sample

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.

Sample

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

Sample

  • 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, 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 release, this library works with Swift 3.0
  • If you look for older languages version support, you can check out the 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.

If you find any bug, a problem while using this library, or have suggestions that can make it better, please open an issue in this repo (or a pull request).

You can also check all of our open-source projects at inaka.github.io.

fadebutton's People

Contributors

elbrujohalcon avatar spike886 avatar gardano 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.