要运行示例项目,请克隆存储库,并先从 Example 目录运行 pod install
将 HZRButtonDelegate 添加到动画完成时的回调
- (void)animatingButtonDidFinishLoading:(HZRButton *)button
创建按钮,按需自定义。
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 通过 CocoaPods 提供。要安装它,只需将以下行添加到 Podfile
pod "HZRButton"
Erdinc Akkaya, [email protected]
HZRButton 在 MIT 许可下提供。关于更多信息,请参阅 LICENSE 文件。