So I have an application featuring a chat section, and I\'m synchronizing the animation of the keyboard hiding and showing with the rise and fall of the
Since the animation curve Apple sends you in the keyboard notification does not have a corresponding UIViewAnimationOption bit, you need to drop down to old-school non-block animations and use the curve directly:
NSTimeInterval duration = [note.userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
UIViewAnimationCurve curve = [note.userInfo[UIKeyboardAnimationCurveUserInfoKey] integerValue];
[UIView beginAnimations:@"SomeAnimationID" context:NULL];
[UIView setAnimationCurve:curve];
[UIView setAnimationDuration:duration];
// Animation code
[UIView commitAnimations];
keyboardWillShow:
NSDictionary *info = [notification userInfo];
CGRect keyboardFrame = [info[UIKeyboardFrameEndUserInfoKey] CGRectValue];
NSTimeInterval duration = [info[UIKeyboardAnimationDurationUserInfoKey] doubleValue];
UIViewAnimationCurve curve = [info[UIKeyboardAnimationCurveUserInfoKey] integerValue];
[self layoutIfNeeded];
[UIView animateWithDuration:duration delay:0 options:(curve << 20) animations:^{
[self.keyboardConstraint setConstant:keyboardFrame.size.height];
[self layoutIfNeeded];
} completion:nil];