Coding⏱️ 1 min read📅 2026-06-03

How to Fix: How to dismiss keyboard for UITextView with return key?

Dismiss keyboard for UITextView with return key without UIButton.

Quick Answer: Use the "Return, Shift Return" gesture in IB's keyboard settings to achieve this.

To dismiss the keyboard for UITextView with return key, you can use the delegate method - (BOOL)textFieldShouldReturn:(UITextField *)textField. This method will be called when the return key is pressed.

Dismissing Keyboard with Return Key

-(BOOL)textFieldShouldReturn:(UITextField *)textField {  [self.txtView resignFirstResponder]; return NO; }

By using NO in the return statement, we are indicating that the text field should not return focus to itself. Instead, we resign the first responder for our UITextView.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions