Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesquires committed Dec 19, 2014
1 parent 9980266 commit 16c42a1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -760,16 +760,23 @@ - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(N

- (void)keyboardController:(JSQMessagesKeyboardController *)keyboardController keyboardDidChangeFrame:(CGRect)keyboardFrame
{
if (![self.inputToolbar.contentView.textView isFirstResponder] && self.toolbarBottomLayoutGuide.constant == 0.0f) {
return;
}

CGFloat heightFromBottom = CGRectGetMaxY(self.collectionView.frame) - CGRectGetMinY(keyboardFrame);

heightFromBottom = MAX(0.0f, heightFromBottom);

[self jsq_setToolbarBottomLayoutGuideConstant:heightFromBottom];

}

- (void)keyboardControllerKeyboardDidHide:(JSQMessagesKeyboardController *)keyboardController
{
if (![self.inputToolbar.contentView.textView isFirstResponder]) {
return;
}

[self jsq_setToolbarBottomLayoutGuideConstant:0.0f];
[self.inputToolbar.contentView.textView resignFirstResponder];
}
Expand Down

0 comments on commit 16c42a1

Please sign in to comment.