A while ago I remember seeing a constant of some kind that defined the animation rate of the Keyboard on the iPhone and I can not for the life of me remember where I saw it.
To add a bit more to what Shaggy Frog wrote. The full implementation would be something like:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardMovement:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardMovement:)
name:UIKeyboardWillHideNotification
object:nil];
-(void)keyboardMovement:(NSNotification *)notification{
if (_numericKeyboardShowing == false){
[UIView animateWithDuration:[self keyboardAnimationDurationForNotification:notification] delay:0
options:UIViewAnimationCurveEaseInOut
animations:^ {
self.bottomContainerView.center = CGPointMake(self.bottomContainerView.center.x, (self.bottomContainerView.center.y - 218));
}
completion:NULL];
_numericKeyboardShowing = true;
}
else{
[UIView animateWithDuration:[self keyboardAnimationDurationForNotification:notification] delay:0
options:UIViewAnimationCurveLinear
animations:^ {
self.bottomContainerView.center = CGPointMake(self.bottomContainerView.center.x, (self.bottomContainerView.center.y + 218));
}
completion:NULL];
_numericKeyboardShowing = false;
}
- (NSTimeInterval)keyboardAnimationDurationForNotification:(NSNotification *)notification
{
NSDictionary *info = [notification userInfo];
NSValue* value = [info objectForKey:UIKeyboardAnimationDurationUserInfoKey];
NSTimeInterval duration = 0;
[value getValue:&duration];
return duration;
}