HGTimerButton 1.0.3

HGTimerButton 1.0.3

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Mar 2017

Maintained by xuhonggui.



  • By
  • xuhonggui

封装NSTimer的UIButton

How to Use

创建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];

License

MIT