Commit 99a0e80f09b3cf39c9b92804ff1f661bfb4c9c45
1 parent
3d792412
0.0.8
Showing
2 changed files
with
6 additions
and
2 deletions
CNLiveCServiceModule.podspec
CNLiveCServiceModule/Classes/View/CNLiveMainSearch.m
| ... | ... | @@ -63,7 +63,11 @@ |
| 63 | 63 | |
| 64 | 64 | #pragma mark - UITextFieldDelegate |
| 65 | 65 | - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string{ |
| 66 | - if (([textField.text isEqualToString:@""]&&[string isEqualToString:@" "]) ||textField.text.length > 20 ) { | |
| 66 | + if (([textField.text isEqualToString:@""]&&[string isEqualToString:@" "]) ||textField.text.length > 20) { | |
| 67 | + return NO; | |
| 68 | + } | |
| 69 | + if (string.length > 20) { | |
| 70 | + [QMUITips showError:@"粘贴内容不能超过20个字符" inView:AppKeyWindow hideAfterDelay:2]; | |
| 67 | 71 | return NO; |
| 68 | 72 | } |
| 69 | 73 | return YES; | ... | ... |