First Register Notification:
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
Then:
-(void)keyboardWillHide:(NSNotification *)_notification {
NSLog(@"%@",[_notification infoDict]);
}
-(void)keyboardWillShow:(NSNotification *)_notification {
NSLog(@"%@",[_notification infoDict]);
}
This will only be called when the internal keyboard is displayed and the external keyboard is not connected! If an external keyboard is connected, the WillShow Notation will not be called.
source
share