How can I find the UIKeyboard
is open in my application or not?
I don't want to use any delegate methods of UITextField
.
Please suggest any solution.
Thanks in advance.
How can I find the UIKeyboard
is open in my application or not?
I don't want to use any delegate methods of UITextField
.
Please suggest any solution.
Thanks in advance.
Test this :
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
Use keyboard notification for check status of UIKeyBoard
.
Keyboard Notifications:
When the system shows or hides the keyboard, it posts several keyboard notifications. These notifications contain information about the keyboard, including its size, which you can use for calculations that involve moving views. Registering for these notifications is the only way to get some types of information about the keyboard. The system delivers the following notifications for keyboard-related events:
UIKeyboardWillShowNotification
UIKeyboardDidShowNotification
UIKeyboardWillHideNotification
UIKeyboardDidHideNotification