Manter o objeto na parte superior do teclado no caso de becomeFirstResponder ou resignFirstResponder?

Atualmente, tenho um UITextField em cima de um teclado. Quando você toca nele, ele deve ficar em cima do teclado e subir suavemente. Não sei a duração exata e o tipo de animação do teclado, por isso é realmente acidentado. Aqui está o que eu tenho:

[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];

Se alguém já fez algo parecido com isso antes, gostaria de saber as configurações usadas para suavizar a animação e parecer que a barra está "presa" na parte superior do teclad

questionAnswers(4)

yourAnswerToTheQuestion