Skip to content
Browse files

Fix contentInset not returning to normal when keyboard hides

-removed the conditions that check for original content inset before doing anything. These made since when the height was being adjusted, but not anymore. They were just causing problems.
  • Loading branch information...
1 parent 0f1aad7 commit 1693dce7bb6751723f0ef4da4cb33231ed789079 @wordofchristian wordofchristian committed
Showing with 0 additions and 4 deletions.
  1. +0 −4 TPKeyboardAvoidingScrollView.m
View
4 TPKeyboardAvoidingScrollView.m
@@ -45,8 +45,6 @@ - (void) touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
}
- (void)keyboardWillShow:(NSNotification*)notification {
- if (!UIEdgeInsetsEqualToEdgeInsets(priorInset, UIEdgeInsetsZero)) return;
-
UIView *firstResponder = [self findFirstResponderBeneathView:self];
if ( !firstResponder ) {
// No child view is the first responder - nothing to do here
@@ -85,14 +83,12 @@ - (void)keyboardWillShow:(NSNotification*)notification {
}
- (void)keyboardWillHide:(NSNotification*)notification {
- if (UIEdgeInsetsEqualToEdgeInsets(priorInset, UIEdgeInsetsZero)) return;
// 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;
- priorInset = UIEdgeInsetsZero;
[UIView commitAnimations];
_keyboardVisible = false;
}

0 comments on commit 1693dce

Please sign in to comment.
Something went wrong with that request. Please try again.