Detecting language change in keyboard for IOS

For detecting IOS keyboard language change when you are in textfield / textview, you can do it in
– (BOOL)textField:(UITextField *)textView shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)text

The following will detect Chinese character (in general) whenever text is input into the textfield.

// This will check if the current character user entered is not a chinese character
if([[UITextInputMode currentInputMode].primaryLanguage rangeOfString:@"zh-"].location != NSNotFound){
// Put your code here.

Posted on March 26, 2013, in Education and tagged , , . Bookmark the permalink. 1 Comment.

  1. super !!! this what i want.. thanks!!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: