Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to know the UIkeyboard is appeared or not in iOS? [duplicate]

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.

like image 750
Sunil Targe Avatar asked Mar 05 '13 08:03

Sunil Targe


People also ask

How do I find my iOS keyboard?

Go to Settings > Accessibility > Keyboards, tap Full Keyboard Access, then turn on Full Keyboard Access. Control your iPhone using keyboard shortcuts. To customize the keyboard shortcuts, tap Commands.

Can you have two Keyboards on iPhone?

Add or remove a keyboard for another languageGo to Settings > General > Keyboard. Tap Keyboards, then do any of the following: Add a keyboard: Tap Add New Keyboard, then choose a keyboard from the list. Repeat to add more keyboards.

Why do I have 2 Keyboards on my iPad?

If your iPad keyboard isn't full-sized and centered at the bottom of your screen, you probably turned on one of these features: Floating keyboard, which is a smaller single keyboard that can move anywhere on the screen. Split keyboard, which divides the keyboard into two halves that can move up and down.


2 Answers

Test this :

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillHide:) name:UIKeyboardWillHideNotification object:nil];
like image 136
VivienCormier Avatar answered Oct 14 '22 06:10

VivienCormier


From official Documentation.

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
like image 4
iPatel Avatar answered Oct 14 '22 07:10

iPatel