How can I programmatically check whether a keyboard is present in iOS app?
ios, keyboard, objective-c
Solution
…or take the easy way:
When you enter a textField, it becomes first responder and the keyboard appears. You can check the status of the keyboard with `[myTextField isFirstResponder]`. If it returns `YES`, then the the keyboard is active.
Problem
I need to check the condition of keyboard visibility in my iOS app. Pseudocode: ``` if(keyboardIsPresentOnWindow) { //Do action 1 } else if (keyboardIsNotPresentOnWindow) { //Do action 2 } ``` How can I check this condition?