title: Setting maximum number of lines entry on UITextView
body: <p>I would like to restrict the user of my <code>iPad</code> app to entering a maximum of 20 lines when outputted on the pdf. The user enters text into the <code>UITextView</code> (as shown below) and this is then later converted into a pdf document.</p>
  
  <p><img src="https://i.stack.imgur.com/WHq7m.png" alt="enter image description here"></p>
  
  <p>I realise that I will have to do a few of calculations depending on what text is entered as they type. Are there any methods that can help me out here? <code>textFieldDidEndEditing</code> only allows me to check after it has been entered.</p>
  
  <p>Also, as this would be far simpler, is there a way of limiting the number of lines a <code>UITextField</code> can be?</p>