Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

Commit

Permalink
address code review comments from PR #646, ref #645, #314, #640
Browse files Browse the repository at this point in the history
  • Loading branch information
jessesquires committed Dec 19, 2014
1 parent 38c14c1 commit 9980266
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@ 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;
- (void)keyboardControllerKeyboardDidHide:(JSQMessagesKeyboardController *)keyboardController;

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,7 @@ - (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];
}

[self.delegate keyboardControllerKeyboardDidHide:self];

This comment has been minimized.

Copy link
@s1m-0n

s1m-0n Jan 6, 2015

crashing because respondsToSelector is missing - removed accidentially?

fixed with:
if ([self.delegate respondsToSelector:@selector(keyboardControllerKeyboardDidHide:)]) {
[self.delegate keyboardControllerKeyboardDidHide:self];
}
please add this to the latest version ;)

This comment has been minimized.

Copy link
@jessesquires

jessesquires Jan 6, 2015

Author Owner

no, this method is @required in the protocol.

JSQMessagesViewController correctly implements this method.

}];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,10 @@ - (void)keyboardController:(JSQMessagesKeyboardController *)keyboardController k

}

- (void)keyboardControllerDidReceiveKeyboardHideNotification:(JSQMessagesKeyboardController *)keyboardController {
- (void)keyboardControllerKeyboardDidHide:(JSQMessagesKeyboardController *)keyboardController
{
[self jsq_setToolbarBottomLayoutGuideConstant:0.0f];

[self.inputToolbar.contentView.textView resignFirstResponder];

This comment has been minimized.

Copy link
@0xbad1

0xbad1 Dec 30, 2014

@jessesquires calling resignFirstResponder in keyboardControllerDidReceiveKeyboardHideNotification causes the keyboard to hide when the screen is rotated. Is that intentional?

This comment has been minimized.

Copy link
@jessesquires

jessesquires Dec 30, 2014

Author Owner

nope! please open an issue for this! 😄

This comment has been minimized.

Copy link
@0xbad1

0xbad1 Dec 30, 2014

Thanks! I've filed an issue: #706

}

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

0 comments on commit 9980266

Please sign in to comment.