Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

sspbond007

macrumors member
Original poster
Aug 19, 2008
46
0
Hi,

I need to check condition is keyboard appearing, in my app.

like:

if(keyboardIsPresentOnWindow){
Do action 1;
}else if(keyboardIsPresentOnWindow){
Do action 2;
}

So please help how to check this condition?

Thanks.
 
Hi,

I need to check condition is keyboard appearing, in my app.

like:

if(keyboardIsPresentOnWindow){
Do action 1;
}else if(keyboardIsPresentOnWindow){
Do action 2;
}

So please help how to check this condition?

Thanks.

Usually the keyboard will be invoked because a textfield or area will become first responder. (pretty much meaning its focused and the keyboard appears). Can you give us some more context in code?
 
When the keyboard appears/disappears a notification is sent. Subscribe to this notification and you'll know if the keyboard is present. Also, the keyboard appears when a textview or textfield is made the first responder. Probably you can query any textfield/view to see if they are the first responder.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.