I want to get the size of the keyboard, and I do this as follows:
- (void)viewDidLoad
{
....
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];
....
}
//I can get the size here
- (void)keyboardWillShow:(NSNotification *)notification
{
NSDictionary *userInfo = [notification userInfo];
NSValue* aValue = [userInfo objectForKey:UIKeyboardFrameEndUserInfoKey];
CGRect keyboardRect = [aValue CGRectValue];
}
But now, I want to get the size before the keyboard is showed (before the "keyboardWillShow" method is called). How can I do it?