Latest 1.0.1
Homepage https://github.com/Shrugs/MCBouncyButton
License MIT
Platforms ios 6.0, requires ARC
Dependencies pop
Frameworks UIKit
Authors

MCBouncyButton

MCBouncyButton in action.

It’s a button! For iOS! And it bounces delightfully!

Install

pod 'MCBouncyButton'

Usage

- (id)initWithImage:(UIImage *)image andRadius:(float)radius;
// OR
- (id)initWithText:(NSString *)text andRadius:(float)radius;

Then you can change styles with

- (void)setStyle:(MCBouncyButtonStyle)style animated:(BOOL)animated;

Where MCBouncyButtonStyle is defined as:

typedef enum {
    MCBouncyButtonStyleDefault,
    MCBouncyButtonStyleSelected
} MCBouncyButtonStyle;

MCBouncyButton will automatically create a negative of your supplied image to use for the selected style.

Properties

You can change the following properties of the button.

Button Properties

  • defaultBodyColor – default button body color (default a system grey)
  • defaultShadowColor – default button shadow color (default a system grey)
  • defaultTextColor – default text color (default black)
  • selectedBodyColor – selected button body color (default a happy blue)
  • selectedShadowColor – selected button shadow color (default a happy blue)
  • selectedTextColor – selected text color (default white)
  • relativeIconInset – distance to inset provided icon based on diameter (default 0.2f);

Animation Properties

  • scaleValue – maximum value to scale button when pressed (default 0.9f)
  • buttonBounciness – POP bounciness value (default 20.0f)
  • buttonSpeed – POP speed value (default 15.0f)

Latest podspec

{
    "name": "MCBouncyButton",
    "version": "1.0.1",
    "summary": "A delightfully bouncy button.",
    "description": "                    MCBouncyButton is a subclass of UIButton that leverages Pop to delightfully bounce due to user interaction.n                    Supports preconfigured styles (default and selected) and you can add your own.n",
    "homepage": "https://github.com/Shrugs/MCBouncyButton",
    "screenshots": "https://raw.githubusercontent.com/Shrugs/MCBouncyButton/master/mcbouncybutton.gif",
    "license": "MIT",
    "authors": {
        "Matt Condon (Shrugs)": "[email protected]"
    },
    "social_media_url": "http://twitter.com/mattgcondon",
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/Shrugs/MCBouncyButton.git",
        "tag": "1.0.1"
    },
    "source_files": "MCBouncyButton/*.{h,m}",
    "frameworks": "UIKit",
    "requires_arc": true,
    "dependencies": {
        "pop": [
            "~> 1.0"
        ]
    }
}

Pin It on Pinterest

Share This