HGTimerButton 1.0.3

HGTimerButton 1.0.3

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2017年3月

xuhonggui维护。



  • 作者
  • xuhonggui

封装了 NSTimer 的 UIButton

如何使用

创建 HGTimerButton 对象,类似于创建 UIButton 对象

HGTimerButton *timerButton = [HGTimerButton buttonWithType:UIButtonTypeCustom];
[timerButton setTitle:@"获取验证码" forState:UIControlStateNormal];
timerButton.titleLabel.font = [UIFont systemFontOfSize:16];
[timerButton addTarget:self action:@selector(timerButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:timerButton];

设置倒计时提示

timerButton.disabledTitleFormat = @"重新获取(&s)";

调用 start 方法开始

[timerButton start];

许可证

MIT