邮箱,手机号格式判断
来源:互联网 发布:淘宝小崔韩代是正品吗 编辑:程序博客网 时间:2024/04/29 17:02
-(void)startTime{ __block int timeout = 59; //倒计时时间 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); dispatch_source_t _timer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0,queue); dispatch_source_set_timer(_timer,dispatch_walltime(NULL, 0),1.0*NSEC_PER_SEC, 0); //每秒执行 dispatch_source_set_event_handler(_timer, ^{ if(timeout<=0){ //倒计时结束,关闭 dispatch_source_cancel(_timer); dispatch_async(dispatch_get_main_queue(), ^{ //设置界面的按钮显示 根据自己需求设置 [_SMS_GetVerifiableCode setTitle:@"获取验证码" forState:UIControlStateNormal]; _SMS_GetVerifiableCode.userInteractionEnabled = YES; }); }else{ int seconds = timeout % 60 ; NSString *strTime = [NSString stringWithFormat:@"%.2d", seconds]; dispatch_async(dispatch_get_main_queue(), ^{ //设置界面的按钮显示 根据自己需求设置 //NSLog(@"____%@",strTime); // [UIView beginAnimations:nil context:nil]; // [UIView setAnimationDuration:1]; [_SMS_GetVerifiableCode setTitle:[NSString stringWithFormat:@"%@秒后重新发送",strTime] forState:UIControlStateNormal]; //[UIView commitAnimations]; _SMS_GetVerifiableCode.userInteractionEnabled = NO; }); timeout--; } }); dispatch_resume(_timer);}
判断手机号:
-(BOOL)checkTelNumber:(NSString*)telNumber{ NSString *MOBILE = @"^1[34578]\\d{9}$"; NSPredicate *regexTestMobile = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",MOBILE]; BOOL isMatch = [regexTestMobile evaluateWithObject:telNumber]; return isMatch;}
判断邮箱:
-(BOOL)isValidateEmail:(NSString *)email{ NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES%@",emailRegex]; return [emailTest evaluateWithObject:email];}
0 0
- 邮箱,手机号格式判断
- Android判断手机号格式邮箱格式
- 正则表达式判断手机号和邮箱格式是否正确
- 判断手机号,邮箱,密码等格式是否正确
- 判断手机号和邮箱
- 验证手机号 和 邮箱格式
- jq判断手机号,邮箱正则
- checkPhone判断手机号格式
- iOS各种判断判断(手机号/邮箱等)
- iOS开发笔记:实现对手机号、邮箱输入格式的判断(正则表达式)
- java中一些数据格式判断、转换的方法(手机号、邮箱格式,byte数组转String)
- android 验证手机号和邮箱格式
- android 判断登录是否邮箱或手机号
- iOS 判断邮箱,手机号是否正确
- ios判断身份证,手机号,邮箱号
- iOS 判断邮箱 手机号 是否正确
- ios 判断邮箱 手机号 是否正确
- iOS判断手机号邮箱网址的正则
- Cassandra学习笔记
- 更轻量的View Controller
- C,C++中使用可变参数
- 鼠标点击右键,反应慢,解决方法!
- SGU 109 Magic of David Copperfield II(构造)
- 邮箱,手机号格式判断
- 基于GB28181RTPoverTCP的发送程序拾遗
- B和B+树
- App Bar
- 转载:Oracle连接方式(dispatchers 设置)
- 双目视觉学习笔记
- C++ ofstream和ifstream详细用法
- 8天学通MongoDB——第三天 细说高级操作
- C++中时间延迟的几种方法