Skip to content

A vivid button with beautiful animation like twitter like button.

License

Notifications You must be signed in to change notification settings

StoryOfMyLife/TTAnimationButton

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

image

TTAnimationButton

A vivid button with beautiful selected animation like twitter like button.

Support custom image shaping using UIButton setImage:forState:.

Build Status

Installation

TTAnimationButton is available on CocoaPods. Just add the following to your project Podfile:

pod 'TTAnimationButton'

Usage

Use like UIButton:

TTAnimationButton *button = [TTAnimationButton buttonWithType:UIButtonTypeCustom];
button.explosionRate = 100;
[button setImage:[UIImage imageNamed:@"heart"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
[button sizeToFit];

Properties

/**
 *  Set button selected image color, default red.
 */
@property (nonatomic, strong) UIColor *imageSelectedColor;

/**
 *  Set button normal image color, default lightGray.
 */
@property (nonatomic, strong) UIColor *imageNormalColor;

/**
 *  Explosion density, higher leads more particles, default 0 with no explosion.
 */
@property (nonatomic, assign) NSInteger explosionRate;

/**
 *  YES to allow customize image size, set before setting image, default NO.
 */
@property (nonatomic, assign) BOOL enableCustomImageSize;

/**
 *  YES to disable the animation, default NO.
 */
@property (nonatomic, assign) BOOL disableAnimation;

About

A vivid button with beautiful animation like twitter like button.

Resources

License

Stars

Watchers

Forks

Packages

No packages published