title: Keeping object on top of keyboard in the event of becomeFirstResponder or resignFirstResponder?
body: <p>I currently have a UITextField on top of a keyboard. When you tap it, it should stick on top of the keyboard and move up smoothly. I don't know the exact duration and animation type of the keyboard, so it's really bumpy. Here's what I have:</p>
  
  <pre><code>[theTextView resignFirstResponder];
  [UIView beginAnimations:nil context:NULL];
  [UIView setAnimationDelegate:self];
  [UIView setAnimationDuration:0.25];
  [UIView setAnimationCurve:UIViewAnimationCurveLinear];
  // Frame changes go here (move down 216px)
  [UIView commitAnimations];
  
  [theTextView becomeFirstResponder];
  [UIView beginAnimations:nil context:NULL];
  [UIView setAnimationDelegate:self];
  [UIView setAnimationDuration:0.25];
  [UIView setAnimationCurve:UIViewAnimationCurveLinear];
  // Frame changes go here (move up 216px)
  [UIView commitAnimations];
  </code></pre>
  
  <p>If anyone has done something like this before, I would like to know the settings you used to make the animation smooth and make it appear that the bar is "stuck" to the top of the keyboard.</p>