How to hide Textbox Keyboard when "Done / Return" Button is pressed Xcode 4.2
UITextView does not have any methods which will be called when the user hits the return key.
Even then if you want to do this, implement the textView:shouldChangeTextInRange:replacementText: method of UITextViewDelegate and in that check if the replacement text is \n, hide the keyboard.
There might be other ways but I am not aware of any.
Make sure you declare support for the UITextViewDelegate protocol.
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { if([text isEqualToString:@"\n"]) { [textView resignFirstResponder]; return NO; } return YES;}