Skip to content

An extension on UIView to add push down states to UITableViewCells and UIButtons through an easy subclass.

License

Notifications You must be signed in to change notification settings

nateansel/PushDownState

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PushDownState

The idea for this framework came from an observation from Max Rudberg. This framework seeks to make his suggestion of buttons in iOS having a “push down state” easier for developers to bring into their own projects.

Button examples

Requirements

  • iOS 8.0+
  • Xcode 8.1+
  • Swift 3.0+

Installation

Carthage

To add PushDownState to your Xcode project using Carthage, specify it in your Cartfile:

github "nateansel/PushDownState"

Run carthage update to build the framework and drag the built PushDownState.framework into your Xcode project.

Usage

To use PushDownState in any file of your project, first

import PushDownState

To add a push down state to UIButtons, UITableViewCells, and UICollectionViewCells, simply subclass either PushDownButton, PushDownTableViewCell, or PushDownCollectionViewCell. A push down state will automatically be added to the UI element.

To fine tune the push down state for buttons or cells, simply edit the four values that you have access to. These values are all @IBInspectable, so they can be changed in your storyboard or xib files.

Currently, you can edit:

var pushDownDuration: TimeInterval
var pushDownScale: CGFloat
var pushDownRoundCorners: Bool
var pushDownBackgroundColor: UIColor?

Todo

  • Add background color manipulation
  • Add support for additional changes in the push down state

License

PushDownState is released under the MIT license. See LICENSE for details.

About

An extension on UIView to add push down states to UITableViewCells and UIButtons through an easy subclass.

Resources

License

Stars

Watchers

Forks

Packages

No packages published