Created
February 1, 2012 05:36
-
-
Save kyleturner/1715317 to your computer and use it in GitHub Desktop.
TextView dismisses when enter key is pressed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text { | |
if([text isEqualToString:@"\n"]) { | |
[textView resignFirstResponder]; | |
return NO; | |
} | |
return YES; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment