title: Limiting pasted string length in UITextView or UITextField
body: <p>The problem of limiting strings that are directly entered into a UITextView or UITextField has been addressed on SO before:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/433337/iphone-sdk-set-max-character-length-textfield">iPhone SDK: Set Max Character length TextField</a></li>
  <li><a href="https://stackoverflow.com/questions/896659/iphone-sdk-3-0-issue">iPhone sdk 3.0 issue</a></li>
  </ul>
  
  <p>However now with OS 3.0 copy-and-paste becomes an issue, as the solutions in the above SO questions don’t prevent pasting additional characters (i.e. you cannot type more than 10 characters into a field that is configured with the above solutions but you can easily paste 100 characters into the same field).</p>
  
  <p>Is there a means of preventing directly entered string <strong>and</strong> pasted string overflow?</p>