Skip to content

Commit

Permalink
Merge pull request jessesquires#646 from evilstudios/keyboard-notific…
Browse files Browse the repository at this point in the history
…ation-fix

Fix jessesquires#645: add 'keyboardDidHide' notification handling
  • Loading branch information
jessesquires committed Dec 19, 2014
2 parents 736d110 + 276e9f9 commit 38c14c1
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ FOUNDATION_EXPORT NSString * const JSQMessagesKeyboardControllerUserInfoKeyKeybo
*/
- (void)keyboardController:(JSQMessagesKeyboardController *)keyboardController keyboardDidChangeFrame:(CGRect)keyboardFrame;

@optional

/**
* Tells the delegate that the keyboard has been hidden.
*
* @param keyboardController The keyboard controller that is notifying the delegate.
*/
- (void)keyboardControllerDidReceiveKeyboardHideNotification:(JSQMessagesKeyboardController *)keyboardController;

@end


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,11 @@ - (void)jsq_didReceiveKeyboardDidHideNotification:(NSNotification *)notification

[self jsq_handleKeyboardNotification:notification completion:^(BOOL finished) {
[self.panGestureRecognizer removeTarget:self action:NULL];

if ([self.delegate respondsToSelector:@selector(keyboardControllerDidReceiveKeyboardHideNotification:)]) {
[self.delegate keyboardControllerDidReceiveKeyboardHideNotification:self];
}

}];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,13 @@ - (void)keyboardController:(JSQMessagesKeyboardController *)keyboardController k
heightFromBottom = MAX(0.0f, heightFromBottom);

[self jsq_setToolbarBottomLayoutGuideConstant:heightFromBottom];

}

- (void)keyboardControllerDidReceiveKeyboardHideNotification:(JSQMessagesKeyboardController *)keyboardController {

[self jsq_setToolbarBottomLayoutGuideConstant:0.0f];

}

- (void)jsq_setToolbarBottomLayoutGuideConstant:(CGFloat)constant
Expand Down

0 comments on commit 38c14c1

Please sign in to comment.