#pragma mark --- 限制名字字数限制
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
if (_nameTextFiled == textField) {
// NSString *toBeString = [_nameTextFiled.text stringByReplacingCharactersInRange:range withString:string];
if (range.location >= 8) { //8代表字符个数, 一个汉字和一个字母都是一个字符
[self showToast:@"昵称长度不能超过8个字, 请您重新输入"];
return NO;
}
}
return YES;
}