Quantcast
Channel: snippet Feed
Viewing all articles
Browse latest Browse all 29

How to hide UITextView Keyboard in OS?

$
0
0

Basically UITextView is for Multi line Text. However if you want to hid the keyboard when the user presses the Return Key using the following snippet:

  1. -(BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString*)text
  2. { 
  3.    if([text isEqualToString:@"\n"])
  4.       {   
  5.  
  6.            [textView resignFirstResponder];      
  7.            returnNO;
  8.     }
  9.    returnYES;
  10. }

Viewing all articles
Browse latest Browse all 29

Trending Articles