I have a modal view that with a UITextView, and the user can enter some text (or not) and close the modal view. There is no point of dismissing the keyboard as it does not dismiss the modal view (this is on purpose), and the UITextView without the keyboard just looks silly.
Is there a way to hide or remove the “Dismiss keyboard” key from the keyboard?
You can’t hide or remove the key, but you can disable it using the
UITextViewDelegateprotocol:If UIKit forces the responder to resign despite the delegate (doubtful, but I haven’t looked closely at the call stack), you can force the keyboard to stay up by observing the
UIKeyboardDidHideNotificationand setting the first responder back to the UITextView:[myUITextView becomeFirstResponder]