I\'m looking for two numbers here: the height in portrait and the height in landscape. Don\'t answer in cm or inches, but rather in pixels.
There was an issue in iOS 7 where the height and width were not swapping in landscape mode, but the issue was fixed in iOS 8.
So, here is the piece of code that would always return the height for iOS7 or iOS8, thereby eliminating the version specific check in your code.
- (void)keyboardWasShown:(NSNotification*)aNotification
{
NSDictionary* info = [aNotification userInfo];
CGSize kbSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
//Always gives the height as the height is of smaller dimension
CGFloat height = (kbSize.height>kbSize.width)?kbSize.width:kbSize.height;
}