iOS7 animations don't behave the same way as in iOS6. They appear to use a different bezier curve. Where iOS6 uses a kind of "easeInOutSine" curve, iOS7 is more of the "easeInOutExpo" kind. (http://matthewlein.com/ceaser/)
Is there a way to use that curve? I want to sync my animations when the keyboard opens/closes.
Update, fixed in 7.1. No longer necessary.
For whatever reason, the animation curve reported on keyboard dismissal is incorrect. It seems to actually be 6 << 16 instead of 7 << 17.
Here's what I do with
UIKeyboardWillChangeFrameNotification
to determine which animation curve to use.Basically I determine if the keyboard frame is hiding by seeing if the new y origin will be just outside our view's frame (
newConstant
). Then based on that I use either 6 or 7:newConstant == 0 ? (6 << 16) : (7 << 16)
The rest is just adjusting my
tableView
contentInset
andscrollIndicatorInsets
, as well as changing the constant on the toolbar that is moving with the keyboard.Here's how I do it (at least when the keyboard is about to be shown)
You get the animation curve from the keyboard notification as usual and translate it to an animation option by bit-shifting it.