I was wondering how I can detect the keyboard in IOS when it is on screen. I am working on it all day but I can't get it to work.
1 Answer
There is special NSNotification to handle that. You can add observer to listen for it (don't forget to unsubscribe)
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShown:) name:UIKeyboardWillShowNotification object:nil]; And then you can handle that in the method:
- (void)keyboardWillShown:(NSNotification *)notification { // handle }