文章目录

很多时候我们的输入不需要emoji表情,TextFilld输入时先判断不反回给编辑框,即可拦截

1
2
3
4
5
6
7
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString*)string{
DLog(@"[[UITextInputMode currentInputMode]primaryLanguage] is %@",);
if ([[[UITextInputMode currentInputMode]primaryLanguage] isEqualToString:@"emoji"]) {
return NO;
}
return YES;
}

文章目录