title: How can I make a UITextField move up when the keyboard is present - on starting to edit?
body: <p>With the iOS SDK:</p>
  <p>I have a <code>UIView</code> with <code>UITextField</code>s that bring up a keyboard. I need it to be able to:</p>
  <ol>
  <li><p>Allow scrolling of the contents of the <code>UIScrollView</code> to see the other text fields once the keyboard is brought up</p>
  </li>
  <li><p>Automatically &quot;jump&quot; (by scrolling up) or shortening</p>
  </li>
  </ol>
  <p>I know that I need a <code>UIScrollView</code>.  I've tried changing the class of my <code>UIView</code> to a <code>UIScrollView</code>, but I'm still unable to scroll the textboxes up or down.</p>
  <p>Do I need both a <code>UIView</code> and a <code>UIScrollView</code>? Does one go inside the other?</p>
  <p>What needs to be implemented in order to automatically scroll to the active text field?</p>
  <p>Ideally as much of the setup of the components as possible will be done in Interface Builder. I'd like to only write code for what needs it.</p>
  <p>Note: the <code>UIView</code> (or <code>UIScrollView</code>) that I'm working with is brought up by a tabbar (<code>UITabBar</code>), which needs to function as normal.</p>
  <hr />
  <p>I am adding the scroll bar just for when the keyboard comes up.  Even though it's not needed, I feel like it provides a better interface because then the user can scroll and change textboxes, for example.</p>
  <p>I've got it working where I change the frame size of the <code>UIScrollView</code> when the keyboard goes up and down. I'm simply using:</p>
  <pre><code>-(void)textFieldDidBeginEditing:(UITextField *)textField {
      //Keyboard becomes visible
      scrollView.frame = CGRectMake(scrollView.frame.origin.x,
                                    scrollView.frame.origin.y,
      scrollView.frame.size.width,
      scrollView.frame.size.height - 215 + 50);   // Resize
  }
  
  -(void)textFieldDidEndEditing:(UITextField *)textField {
      // Keyboard will hide
      scrollView.frame = CGRectMake(scrollView.frame.origin.x,
                                    scrollView.frame.origin.y,
                                    scrollView.frame.size.width,
                                    scrollView.frame.size.height + 215 - 50); // Resize
  }
  </code></pre>
  <p>However, this doesn't automatically &quot;move up&quot; or center the lower text fields in the visible area, which is what I would really like.</p>