iOS 验证码倒计时
来源:互联网 发布:增加usb电流软件 编辑:程序博客网 时间:2024/05/24 06:43
属性
@property (weak, nonatomic) IBOutlet UIButton *getCodeBtn;@property (nonatomic, assign) NSInteger secondsCountDown;@property (nonatomic, strong) NSTimer *countDownTimer;
方法
//倒计时- (void)timeOutAction{ _secondsCountDown = 60; [_getCodeBtn setTitle:@"60 s" forState:(UIControlStateNormal)]; _getCodeBtn.backgroundColor = kSubTextColor; _getCodeBtn.enabled = NO; self.countDownTimer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(timeFireMethod) userInfo:nil repeats:YES];}-(void)timeFireMethod{ [_getCodeBtn setTitle:[NSString stringWithFormat:@"%ld s",(long)_secondsCountDown] forState:(UIControlStateNormal)]; _secondsCountDown--; NSLog(@"%ld",_secondsCountDown); if(_secondsCountDown == -1){ [_getCodeBtn setTitle:@"获取验证码" forState:(UIControlStateNormal)]; _getCodeBtn.backgroundColor = kBlueColor; _getCodeBtn.enabled = YES; [_countDownTimer invalidate]; }}
阅读全文
0 0
- ios 验证码倒计时
- ios 验证码倒计时
- ios 验证码倒计时
- iOS 验证码倒计时
- iOS 获取验证码倒计时
- iOS - 验证码,倒计时按钮
- iOS -- 倒计时获取验证码
- iOS 倒计时功能(短信验证码)
- IOS 获取验证码倒计时(timer)
- iOS GCD实现发送验证码倒计时
- IOS短信验证码倒计时添加
- iOS-获取验证码中的倒计时功能
- iOS - 实现验证码倒计时功能
- iOS发送短信后验证码倒计时
- iOS 之获取短信验证码倒计时
- iOS 开发获取验证码倒计时
- IOS验证码倒计时(GCD)
- IOS验证码倒计时(NSTimer)
- 目标检测RCNN-YOLO-SSD系列学习资料汇总
- Markdown字体颜色、大小
- PLSQL编程4:plsql游标的用法
- HttpClient容易忽视的细节——连接关闭
- 金海佳学C++primer 练习9.4/9.5
- iOS 验证码倒计时
- 机器学习
- [POJ](3050)Hopscotch---- 裸dfs+set容器
- Python写Gui窗口
- [POJ1741]Tree(点分治+讲解)
- 【Scikit-Learn 中文文档】双聚类
- Uva 10763
- 阿里云工业互联网云平台落地广东,智造大省打响「互联网+先进制造」登陆战
- pat乙级真题 1050. 螺旋矩阵(25)