Skip to content

Instantly share code, notes, and snippets.

@harry1064
Created September 28, 2015 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harry1064/e92f163e553e77b152d4 to your computer and use it in GitHub Desktop.
Save harry1064/e92f163e553e77b152d4 to your computer and use it in GitHub Desktop.
up vote
55
down vote
Here is the cleanest way to achieve this in iOS 7.0.
scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeOnDrag;
Or
scrollView.keyboardDismissMode = UIScrollViewKeyboardDismissModeInteractive;
Swift:
scrollView.keyboardDismissMode = .OnDrag
Or
scrollView.keyboardDismissMode = .Interactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment