It's a button! For iOS! And it bounces delightfully!
pod 'MCBouncyButton'
- (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.
You can change the following properties of the button.
- 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);
- 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)