UIKeyboardWillChangeFrameNotification UIViewAnimationCurve set to 7 on iOS 7

It seems that the keyboard is using an undocumented/unknown animation curve.

But you can still use it. To convert it to a UIViewAnimationOptions for block animations shift it by 16 bits like so

UIViewAnimationCurve keyboardTransitionAnimationCurve;
[[notification.userInfo valueForKey:UIKeyboardAnimationCurveUserInfoKey]
                           getValue:&keyboardTransitionAnimationCurve];

keyboardTransitionAnimationCurve |= keyboardTransitionAnimationCurve<<16;

[UIView animateWithDuration:0.5
                  delay:0.0
                options:keyboardTransitionAnimationCurve
             animations:^{
                // ... do stuff here
           } completion:NULL];

Or just pass it in as an animation curve.

UIViewAnimationCurve keyboardTransitionAnimationCurve;
[[notification.userInfo valueForKey:UIKeyboardAnimationCurveUserInfoKey]
                           getValue:&keyboardTransitionAnimationCurve];

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:keyboardTransitionAnimationCurve];
// ... do stuff here
[UIView commitAnimations];

Tags:

Ios

Uikeyboard