Skip to content

Commit

Permalink
修复以前一个手误
Browse files Browse the repository at this point in the history
  • Loading branch information
MoLice committed Aug 28, 2017
1 parent b712a6a commit 5f278e5
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions QMUIKit/UIComponents/QMUIKeyboardManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,8 @@ @interface QMUIKeyboardManager ()
@property(nonatomic, strong) QMUIKeyboardUserInfo *keyboardMoveUserInfo;
@property(nonatomic, assign) CGRect keyboardMoveBeginRect;

@property(nonatomic, assign) BOOL debug;

@end

static UIResponder *kCurrentResponder = nil;
Expand Down Expand Up @@ -343,8 +345,10 @@ - (void)addKeyboardNotification {

- (void)keyboardWillShowNotification:(NSNotification *)notification {

NSLog(@"keyboardWillShowNotification - %@", self);
NSLog(@"\n");
if (self.debug) {
NSLog(@"keyboardWillShowNotification - %@", self);
NSLog(@"\n");
}

if (![self shouldReceiveShowNotification]) {
return;
Expand All @@ -366,8 +370,10 @@ - (void)keyboardWillShowNotification:(NSNotification *)notification {

- (void)keyboardDidShowNotification:(NSNotification *)notification {

NSLog(@"keyboardDidShowNotification - %@", self);
NSLog(@"\n");
if (self.debug) {
NSLog(@"keyboardDidShowNotification - %@", self);
NSLog(@"\n");
}

QMUIKeyboardUserInfo *userInfo = [self newUserInfoWithNotification:notification];
userInfo.targetResponder = kCurrentResponder ?: nil;
Expand All @@ -378,7 +384,7 @@ - (void)keyboardDidShowNotification:(NSNotification *)notification {
if (shouldReceiveDidShowNotification) {

if (self.delegateEnabled && [self.delegate respondsToSelector:@selector(keyboardDidShowWithUserInfo:)]) {
[self.delegate keyboardDidShowWithUserInfo:nil];
[self.delegate keyboardDidShowWithUserInfo:userInfo];
}

// 额外处理iPad浮动键盘
Expand All @@ -391,8 +397,10 @@ - (void)keyboardDidShowNotification:(NSNotification *)notification {

- (void)keyboardWillHideNotification:(NSNotification *)notification {

NSLog(@"keyboardWillHideNotification - %@", self);
NSLog(@"\n");
if (self.debug) {
NSLog(@"keyboardWillHideNotification - %@", self);
NSLog(@"\n");
}

if (![self shouldReceiveHideNotification]) {
return;
Expand All @@ -414,8 +422,10 @@ - (void)keyboardWillHideNotification:(NSNotification *)notification {

- (void)keyboardDidHideNotification:(NSNotification *)notification {

NSLog(@"keyboardDidHideNotification - %@", self);
NSLog(@"\n");
if (self.debug) {
NSLog(@"keyboardDidHideNotification - %@", self);
NSLog(@"\n");
}

QMUIKeyboardUserInfo *userInfo = [self newUserInfoWithNotification:notification];
userInfo.targetResponder = kCurrentResponder ?: nil;
Expand Down Expand Up @@ -443,8 +453,10 @@ - (void)keyboardDidHideNotification:(NSNotification *)notification {

- (void)keyboardWillChangeFrameNotification:(NSNotification *)notification {

NSLog(@"keyboardWillChangeFrameNotification - %@", self);
NSLog(@"\n");
if (self.debug) {
NSLog(@"keyboardWillChangeFrameNotification - %@", self);
NSLog(@"\n");
}

QMUIKeyboardUserInfo *userInfo = [self newUserInfoWithNotification:notification];

Expand All @@ -469,8 +481,10 @@ - (void)keyboardWillChangeFrameNotification:(NSNotification *)notification {

- (void)keyboardDidChangeFrameNotification:(NSNotification *)notification {

NSLog(@"keyboardDidChangeFrameNotification - %@", self);
NSLog(@"\n");
if (self.debug) {
NSLog(@"keyboardDidChangeFrameNotification - %@", self);
NSLog(@"\n");
}

QMUIKeyboardUserInfo *userInfo = [self newUserInfoWithNotification:notification];

Expand Down Expand Up @@ -579,8 +593,10 @@ - (void)keyboardDidChangedFrame:(UIView *)keyboardView {
keyboardMoveUserInfo.beginFrame = self.keyboardMoveBeginRect;
keyboardMoveUserInfo.endFrame = endFrame;

NSLog(@"keyboardDidMoveNotification - %@", self);
NSLog(@"\n");
if (self.debug) {
NSLog(@"keyboardDidMoveNotification - %@", self);
NSLog(@"\n");
}

[self.delegate keyboardWillChangeFrameWithUserInfo:keyboardMoveUserInfo];

Expand Down

0 comments on commit 5f278e5

Please sign in to comment.