if (btn.tag == TAG_BTN_IDENTIFIER)
{
NSLog(@"获取验证码");
_btn.enabled = NO;
[_btn setTitleColor:[UIColor grayColor] forState:UIControlStateNormal];
_btn.layer.borderColor = [UIColor grayColor].CGColor;
_timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeMethod) userInfo:nil repeats:YES];
}
#pragma mark - 按钮倒计时
- (void)timeMethod
{
_itimer --;
[_btn setTitle:[NSString stringWithFormat:@"已发送(%d)",_itimer] forState:UIControlStateNormal];
if (_itimer == 0)
{
[_timer invalidate];
[_btn setTitle:@"获取验证码" forState:UIControlStateNormal];
[_btn setTitleColor:RGBCOLOR(51, 191, 18) forState:UIControlStateNormal];
_btn.layer.borderColor = RGBCOLOR(51, 191, 18).CGColor;
_btn.enabled = YES;
_itimer = 60;
}
}