I solved the problem by modifying following method. Take a look at the difference here.
Before:
- (void)keyboardWillHide:(NSNotification*)notification
{
_keyboardRect = CGRectZero;
_keyboardVisible = NO;
// Restore dimensions to prior size
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]];
[UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]];
self.contentInset = _priorInset;
[self setScrollIndicatorInsets:self.contentInset];
_priorInsetSaved = NO;
[UIView commitAnimations];
}
After:
- (void)keyboardWillHide:(NSNotification*)notification
{
_keyboardRect = CGRectZero;
// Restore dimensions to prior size
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationCurve:[[[notification userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey] intValue]];
[UIView setAnimationDuration:[[[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey] floatValue]];
self.contentInset = _priorInset;
[self setScrollIndicatorInsets:self.contentInset];
_priorInsetSaved = NO;
[self adjustOffsetToIdealIfNeeded];
[UIView commitAnimations];
_keyboardVisible = NO;
}