Skip to content

Instantly share code, notes, and snippets.

@kyleturner
Created February 1, 2012 05:36
Show Gist options
  • Save kyleturner/1715317 to your computer and use it in GitHub Desktop.
Save kyleturner/1715317 to your computer and use it in GitHub Desktop.
TextView dismisses when enter key is pressed
- (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