How to detect hidden event of international keyboard? IOS

How to detect hidden event of international keyboard? UIKeyboardDidHideNotification does not seem to work.

The link below is not suitable.

detect the appearance and disappearance of an international keyboard

ADDITIONAL INFORMATION

This is how I set the notification for both UIKeyboardDidHideNotification and UIKeyboardDidShowNotification

 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidShow:) name:UIKeyboardDidShowNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardDidHide:) name:UIKeyboardDidHideNotification object:nil]; -(void)keyboardDidShow:(NSNotification*)notification { NSLog(@"keyboardDidShow"); } -(void)keyboardDidHide:(NSNotification*)notification { NSLog(@"keyboardDidHide"); } 

keyboardDidShow runs twice. Firstly, when a standard keyboard is issued. Secondly, when an international keyboard is issued.

keyboardDidHide does NOT start when I hide the international keyboard. But it starts when the standard keyboard is hidden.

Did I miss something?

+4
source share
1 answer

You do not receive notifications if the user changes the keyboard. Only if the keyboard appears or disappears.

The only solution I know about is to observe or react to changes (Try KVO?) On

 [UITextInputMode currentInputMode].primaryLanguage 

See also: Detect iPhone's current input language

0
source

Source: https://habr.com/ru/post/1487045/


All Articles