Created
January 16, 2014 20:23
-
-
Save aug2uag/8462729 to your computer and use it in GitHub Desktop.
Cocoa textView dismiss on return
This file contains hidden or 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 rangeOfCharacterFromSet:[NSCharacterSet newlineCharacterSet]].location == NSNotFound ) { | |
| return YES; | |
| } | |
| [self animateTextView:NO]; | |
| [textView resignFirstResponder]; | |
| return NO; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment