Dismiss keyboard with swipe gesture (as in Message app)

Michael Stet picture Michael Stet · Aug 20, 2011 · Viewed 22.5k times · Source

When the keyboard is showing on the iPhone's Messages app, if the user begins a swipe down from the messages tableview and continues into the keyboard area, the keyboard will begin to dismiss. If they move their finger up and down during this process, the keyboard moves with it.

Are Apple doing this with private APIs, or is there a way to control the keyboard like this from (I presume) a gesture recognizer?

Answer

Daniel Amitay picture Daniel Amitay · Feb 19, 2012

I created a UIView category that provides the desired functionality:

https://github.com/danielamitay/DAKeyboardControl

Edit: It has indeed been used on the app store.