/关于登录输入与输入密码的判断/
- (BOOL)jdugeWithLoginText {
手机号的正则
NSString *phoneRegex = @"((13[0-9])|(15[4,\D])|(14[1-9])|(17[0,0-9])|(18[0,0-9]))\d{8}$";
NSPredicate *phoneTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", phoneRegex];
BOOL isSurePhoneNumber = [phoneTest evaluateWithObject:self.loginView.loginField.text];
return isSurePhoneNumber;
}
- (BOOL)jdgueWithPassText {
字母和数字的正则
NSString *passWordRegex = @"^[a-zA-Z0-9]{6,20}+$";
NSPredicate *passWordPredicate = [NSPredicate predicateWithFormat:@"SELF MATCHES %@",passWordRegex];
BOOL isSurePassword = [passWordPredicate evaluateWithObject:self.loginView.passField.text];
return isSurePassword;
}