屏蔽emoji表情输入

-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
//    if ([[[UITextInputMode currentInputMode] primaryLanguage] isEqualToString:@"emoji"]) {
//        return NO;
//    }
    
    if ([[[UIApplication sharedApplication] textInputMode].primaryLanguage isEqualToString:@"emoji"]) {
        return NO;
    }
    return YES;
}

你可能感兴趣的:(屏蔽emoji表情输入)