When the keyboard is up in the new Messaging application in iOS5, you can scroll with your finger through the messages. If, while scrolling, you drag your finger into the keyboard, it will push the keyboard down (only as far as your finger pushes, it doesn’t simply dismiss the keyboard immediately). I am trying to recreate this effect in an existing view nearly identical to Apple’s. There are two problems I haven’t figured out yet. How can I change the keyboard frame, and how can I detect where it SHOULD be, given that the scroll view eats the touch events when scrolling? I’m trying to do this in iOS4 if at all possible, but if the technique relies on iOS5-only features, I’d love to know that as well.
Share
You could do this with a UIPanGestureRecognizer. Then you can try to grab the UIWindow containing the keyboard. Since the keyboard is presented in a UIWindow, you should be able to cycle through the windows in your app and find the keyboard window. I’m not sure if you’ll be able to modify it’s bounds though. Worth a shot!
Looks like someone else tried this:
https://github.com/orta/iMessage-Style-Receding-Keyboard
Here is the SO post:
iMessage Style Receding Keyboard in an iOS App