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?
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With