IOS 填写密码
2015-08-01 11:15
316 查看
[code]//完成 -(void)commitAction{ NSString *regex = @"^[\\@A-Za-z0-9\\!\\#\\$\\%\\^\\&\\*\\.\\~]{6,20}$"; NSPredicate *pred = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex]; BOOL isMatch = [pred evaluateWithObject:self.password.text]; if (self.password.text.length==0) { [CommenData showMsgError:self.navigationController.view showMsg:@"密码不能为空"]; return; }else if(!isMatch){ [CommenData showMsgError:self.navigationController.view showMsg:@"密码须是6-20位字母、数字或符号"]; return; }else if(![self.password.text isEqual:self.passwordagain.text]){ [CommenData showMsgError:self.navigationController.view showMsg:@"两次输入密码不一致"]; return; } if([self.showWho isEqualToString:@"1"]){ //修改密码 [self updatePassAction]; }else{ //注册 [self registeAction]; } }
[code]+(void)showMsgError:(UIView *)view showMsg:(NSString *)msg{ if(view){ MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES]; hud.mode = MBProgressHUDModeText; hud.labelText =msg; hud.margin =15.f; hud.removeFromSuperViewOnHide = YES; hud.userInteractionEnabled=NO; [hud hide:YES afterDelay:2]; }else{ NSLog(@"chu cuo la la la la la la la la"); } }
相关文章推荐
- IOS 使用shareSDK发送验证码
- IOS 页面跳转
- 简单的跑马灯效果
- iOS自定义cell导致数据加载混乱
- IOS navigation 返回按钮 不显示文字
- 斯坦福大学iOS8公开课笔记03—自动引用计数(ARC)、static、属性观察器、惰性实例化
- iOS开发之遍历Model类的属性并完善使用Runtime给Model类赋值
- ios协议里的属性
- IOS 实现多种分类 添加删除排序功能(LXReorderableCollectionViewFlowLayout)
- 双系统IOS\windows7 换成Windows10后果
- iOS 宏
- 如何用代码开启“个人热点”功能?如何用代码把iOS设备设置成一个无线路由?
- iOS设计模式 - 装饰
- ios 当键盘出现遮挡视图 视图上移Bug
- iOS
- iOS开发 - Quartz2D绘制小黄人
- iOS开发 - Quartz2D绘图
- IOS中延时执行的几种方式的比较和汇总
- ios开发之给Xcode安装颜色主题及自动注释插件
- Foundation框架提供的一些基本对象的用法之数字对象