title: iOS: how to change the size of the UIScrollView content?
body: <p>I'm now trying to create my own Text panel (with code highlighting and so on).</p>
  
  <p>In fact everything is ready except one thing - scrolling</p>
  
  <p>What I've done:
  created <code>UIScrollView</code> and inserted my own view as a <code>subview</code> using Interface builder.</p>
  
  <p>in <code>ViewController</code> <code>viewDidLoad</code> method I've pointed initial <code>textfield</code> size to be the <code>UIScrollView</code> content size.</p>
  
  <p>And when user writes too much into my text field. I call delegate (which is <code>ViewController</code>) to change size.
  To do that I simply write</p>
  
  <pre><code>[scrollView setContentSize:newSize];
  </code></pre>
  
  <p>And what I get is increasing of the scroll view but not my text field  - just blank lines appears. I think I need to set my view's size too but I can't figure out how...</p>
  
  <p>And a second part of my question:
  Every time I call <code>[textField setNeedsDisplay]</code> it calls <code>drawRect:</code> method with rectangle which is equal to the whole size of my view (which is much bigger than it's visible part). What will it look like if I try to use my view to modify file which size is more than 3 mb? How can I force it to redraw only visible part?</p>
  
  <p>Thanks for your attention.</p>