TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2016 |
Maintained by momo13014.
Countdown Button, with GCD, what you can do with code or XIB.
用GCD实现倒计时Button, 可以在多线程中使用,不用担心循环引用。
可以用纯代码或者Xib创建。
//设置变化过程中Button的title,如
[SDCountDownButton setChangingFormatter:^NSString *(NSTimeInterval second) {
return [NSString stringWithFormat:@"%.0lf S", second];
}];
//设置倒计时结束后的title
[self.one setFinishedString:@"涨涨涨"];
//倒计时结束后的回调
[SDCountDownButton completed:^{
NSLog(@"The count down is over.");
}];