title: iOS8 UIKeyboardWillShowNotification Third party keyboard height
body: <p>I have a UI that needs some position adjustments when a keyboard is shown.</p>
  
  <p>The following is used to detect when a keyboard is shown:</p>
  
  <pre><code>[[NSNotificationCenter defaultCenter] addObserver:self
                                           selector:@selector(keyboardWillShow:)
                                               name:UIKeyboardWillShowNotification
                                             object:nil];
  </code></pre>
  
  <p>Note: I've tried with both UIKeyboardWillShowNotification and UIKeyboardDidShowNotification</p>
  
  <pre><code>- (void)keyboardWillShow:(NSNotification *)n {
      if (isKeyboardShowing)
      return;
  
  NSDictionary* userInfo = [n userInfo];
  
  // get the size of the keyboard
  CGSize keyboardSize = [[userInfo objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
  
  
  // Animate keyboard shift
  [self.view layoutIfNeeded];
  
  [UIView animateWithDuration:0.2f animations:^{
      // some animation here
  } completion:^(BOOL finished) {
      if (finished)
          isKeyboardShowing = YES;
  }];
  </code></pre>
  
  <p>For custom keyboards the keyboard size returns {320, 0}. As keyboards can have different heights now, I cannot have static values to change the UI when keyboard is presented.</p>
  
  <p>Is this an issue with ios8? and are there any other methods to dynamically get the keyboard height?</p>
  
  <p>Edit: This is the userInfo Dict:</p>
  
  <pre><code>{name = UIKeyboardDidShowNotification; userInfo = {
      UIKeyboardAnimationCurveUserInfoKey = 7;
      UIKeyboardAnimationDurationUserInfoKey = "0.25";
      UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {320, 0}}";
      UIKeyboardCenterBeginUserInfoKey = "NSPoint: {160, 568}";
      UIKeyboardCenterEndUserInfoKey = "NSPoint: {160, 568}";
      UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 568}, {320, 0}}";
      UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 568}, {320, 0}}";
  }}
  </code></pre>
  
  <p>Thanks in advance.</p>