title: How do I limit characters in UITextView ?
body: <p>I have been looking for solutions and found the following piece of code. But I do not know how to use it, unfortunately. </p>
  
  <pre><code>- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)string {
          NSUInteger newLength = [textField.text length] + [string length] - range.length;
          return (newLength &gt; 25) ? NO : YES;
      }
  </code></pre>
  
  <p><strong>Just for testing purposes I set up an <code>IBACTION</code></strong></p>
  
  <pre><code>-(IBAction)checkIfCorrectLength:(id)sender{
      [self textView:myTextView shouldChangeTextInRange: ?? replacementText: ?? ];
  
  }
  </code></pre>
  
  <p>What do I pass for <code>shouldChangeTextInRange</code> and <code>replacementText</code> ? 
  Or am I getting it completely wrong ? </p>