iPhone - knowing the keyboard size when it is already shown
<p>OK, I know I can read the keyboard size using the notification <strong>UIKeyboardWillShowNotification</strong> and this</p>

<pre><code>keybSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
</code></pre>

<p>but this will just be available when the keyboard shows.</p>

<p>but the problem is this: I have a window that has to adjust itself to a new position when the keyboard is visible and when iPhone rotates. When I rotate the iPhone both delegates method <strong>willRotateToInterfaceOrientation</strong> and <strong>didRotateFromInterfaceOrientation</strong> run and handle the rotation. Inside these methods I need to know the current keyboard height, so I can position the view properly. The problem is that the method fired by the  UIKeyboardWillShowNotification notification runs after the rotation was handled by the delegate methods.</p>

<p>The order the methods run is:</p>

<ol>
<li>willRotateToInterfaceOrientation</li>
<li>didRotateFromInterfaceOrientation</li>
<li>UIKeyboardWillShowNotification method</li>
</ol>

<p>In other words, the keyboard height is just read at the end, what means both methods 1 and 2 will use the old keyboard height.</p>

<p>My question is: is there a way to read the keyboard height of a visible keyboard directly instead of relying in methods fired by notifications?</p>

<p>thanks</p>
