if (range.length + range.location > inputView.text.length) {
return NO;
}
NSUInteger newLength = inputView.text.length + string.length - range.length;
if ([inputView.typeName isEqualToString:@"手机号码"]) {
return newLength <= 11;
}else if ([inputView.typeName isEqualToString:@"验证码"]) {
return newLength <= 6;
}else {
return YES;
}
网友评论