To run the example project, clone the repo, and run pod install from the Example directory first.
Add HZRButtonDelegate to get callback when animation finished,
- (void)animatingButtonDidFinishLoading:(HZRButton *)button
Create button, customize as you want.
HZRButton *button = [[HZRButton alloc]init];
....
....
[button addTarget:self action:@selector(save:) forControlEvents:UIControlEventTouchUpInside];
- (void)save:(HZRButton *)sender{
[file saveInBackgroundWithBlock:^(BOOL succeed, NSError *error) {
NSLog(@"upload succeeded");
} progressBlock:^(int percentDone) {
[sender updatePercentage:percentDone]; // keep updating the percentage.
}];
}
// this is called when the loading animation finished.
- (void)animatingButtonDidFinishLoading:(HZRButton *)button{
NSLog(@"loading finished %@", button);
}
HZRButton is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "HZRButton"
Erdinc Akkaya, [email protected]
HZRButton is available under the MIT license. See the LICENSE file for more info.