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 b
Luckily, Apple added the handy property keyboardDismissMode
on UIScrollView
to make your life a little easier.
Now your app can behave like Messages.app just by changing a single property on your Storyboard, or alternatively by adding one line of code!
This property uses the new UIScrollViewKeyboardDismissMode
enum. The possible values of this enum are as follows:
UIScrollViewKeyboardDismissModeNone // the keyboard is not dismissed automatically when scrolling
UIScrollViewKeyboardDismissModeOnDrag // dismisses the keyboard when a drag begins
UIScrollViewKeyboardDismissModeInteractive // the keyboard follows the dragging touch off screen, and may be pulled upward again to cancel the dismiss
Here’s the Storyboard property to change to dismiss the keyboard on scroll:
Hope that helps solving your problem