Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dismiss keyboard with swipe gesture

In Messages.app you can dismiss the keyboard down by scrolling the list view. To be clear, it isn't simply responding to a scrollViewDidScroll event. The keyboard tracks with your finger as you swipe down. Any idea how this is done?

like image 459
colindunn Avatar asked May 05 '15 00:05

colindunn


People also ask

How do you dismiss a keyboard?

Android devices have a solution; press the physical back button (provided on some mobile phones) or the soft key back button, and it closes the keyboard.

How do I dismiss my keyboard on Android?

You can force Android to hide the virtual keyboard using the InputMethodManager, calling hideSoftInputFromWindow , passing in the token of the window containing your focused view. This will force the keyboard to be hidden in all situations. In some cases you will want to pass in InputMethodManager.


1 Answers

Since iOS 7, you can use

scrollView.keyboardDismissMode = .Interactive 

From the documentation:

UIScrollViewKeyboardDismissModeInteractive

The keyboard follows the dragging touch offscreen, and can be pulled upward again to cancel the dismiss.

like image 139
Gabriele Petronella Avatar answered Sep 21 '22 04:09

Gabriele Petronella