danielamitay/DAKeyboardControl

iPad split & undocked keyboards

Closed this issue · 1 comments

My app (MUDRammer - a Modern MUD Client for iPhone and iPad) depends on DAKeyboardControl for repositioning its input bar when the keyboard shows and hides. Thanks very much for a great component.

Is there a general solution for iPad split and undocked keyboards? These actions either don't generate the standard UIKeyboardWillShowNotification / UIKeyboardWillHideNotification notifications -- or generate only a subset of them -- and DAKeyboardControl is calling my action handler block with some peculiar keyboard frames:

{{9.86076e-32, -64}, {0, 0}} (Initial call, when first undocked or split)
{{7.08514e-32, -64}, {3.01408e-17, 0}} (After dragging the keyboard around for a while)

This tends to corrupt my app's layout. On the bright side, I am able to recover my layout if the keyboard is re-docked (or un-split) because the rects passed into my action handler are sane again.

My solution is to check if the keyboard rect passed into my action handler has an origin-y < 0.

If so, I assume the keyboard is undocked or split and anchor my input view to the bottom of the window. The keyboard can be panned around, split, and unsplit, and the input view stays in place.