Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianludwig committed May 29, 2016
1 parent 9655cbc commit 71c2256
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions JSQMessagesViewController/Controllers/JSQMessagesViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,15 +304,6 @@ - (void)viewDidAppear:(BOOL)animated
}
}

- (void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];

if (!self.inputToolbar.contentView.textView.isFirstResponder) {
[self jsq_setToolbarBottomLayoutGuideConstant:self.bottomLayoutGuide.length];
}
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
Expand Down Expand Up @@ -926,13 +917,13 @@ - (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 == self.bottomLayoutGuide.length) {
if (![self.inputToolbar.contentView.textView isFirstResponder] && self.toolbarBottomLayoutGuide.constant == 0.0) {
return;
}

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

heightFromBottom = MAX(self.bottomLayoutGuide.length, heightFromBottom);
heightFromBottom = MAX(0.0, heightFromBottom);

[self jsq_setToolbarBottomLayoutGuideConstant:heightFromBottom];
}
Expand Down Expand Up @@ -970,7 +961,7 @@ - (void)jsq_handleInteractivePopGestureRecognizer:(UIGestureRecognizer *)gesture
[self.inputToolbar.contentView.textView resignFirstResponder];
[UIView animateWithDuration:0.0
animations:^{
[self jsq_setToolbarBottomLayoutGuideConstant:self.bottomLayoutGuide.length];
[self jsq_setToolbarBottomLayoutGuideConstant:0.0];
}];

UIView *snapshot = [self.view snapshotViewAfterScreenUpdates:YES];
Expand Down

0 comments on commit 71c2256

Please sign in to comment.