Take the 2-minute tour ×

This question already has an answer here:

I wonder how to prepare similar functionality to Skype app, which allow user down drag UITableVIew to hide in live mode UIKeyboard. Do you have any suggestions to resolve this issue, or maybe have used before of some cocopods?

share|improve this question

marked as duplicate by Jesse Rusak Jun 28 at 1:44


1 Answer 1

As of iOS 7, this functionality has been built into the UIScrollView class

Choose whichever of these fits your needs best.

scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;
scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;

If however you want to achieve this in an older iOS version, you can't do anything interactive, but you can use the UIScrollViewDelegate method scrollViewWillBeginDragging: to dismiss the keyboard when the user starts scrolling.

share|improve this answer
