Sometimes we want to not allow UIKeyboard disappear. Look at a chat in “WhatsApp” app. When you click twice on a chat item, keyboard doesn’t disappear. At the same time you see a custom UIMenuController. This is not a default behavior. By default keyboard disappears since to show UIMenuController you need to make your chat item view become first responder.
The most popular way to make this happen is to use an invisible UITextField or UITextView and make it becomeFirstReposnder after menu is shown.
But there is a very elegant solution using UIKeyInput Protocol. I found it also at that place.
A subclass of UIResponder can adopt this protocol to implement simple text entry. When instances of this subclass are the first responder, the system keyboard is displayed.
Only a small subset of the available keyboards and languages are available to classes that adopt this protocol.
So I decided to use this solution. And it worked perfect! You just need to add this protocol to your class definition. For instance:
@interface UIBubbleTableViewCell : UITableViewCell <UIKeyInput>