CGFloat h = 216; if ([notification.userInfo isKindOfClass:[NSDictionary class]] && notification.userInfo) { NSValue *value = [notification.userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey]; CGSize keyboardSize = [value CGRectValue].size; h = keyboardSize.height; }