File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -721,6 +721,8 @@ - (void)keyboardWillHide:(NSNotification *)notification
721721 NSTimeInterval animationDuration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue ];
722722 UIViewAnimationOptions animationCurve = [userInfo[UIKeyboardAnimationCurveUserInfoKey] unsignedIntegerValue ] << 16 ;
723723
724+ _keyboardIsVisible = NO ;
725+
724726 [UIView animateWithDuration: animationDuration delay: 0 options: animationCurve animations: ^{
725727 CGRect contentFrame = self.contentView .frame ;
726728 contentFrame.origin .y = self->_tmpContentViewFrameOrigin .y ;
@@ -730,11 +732,12 @@ - (void)keyboardWillHide:(NSNotification *)notification
730732 circleFrame.origin .y = self->_tmpCircleViewFrameOrigin .y ;
731733 self.circleViewBackground .frame = circleFrame;
732734 } completion: ^(BOOL finished) {
733- self->_tmpContentViewFrameOrigin = CGPointZero;
734- self->_tmpCircleViewFrameOrigin = CGPointZero;
735+ // Only reset if keyboard hasn't been shown again during the animation
736+ if (!self->_keyboardIsVisible ) {
737+ self->_tmpContentViewFrameOrigin = CGPointZero;
738+ self->_tmpCircleViewFrameOrigin = CGPointZero;
739+ }
735740 }];
736-
737- _keyboardIsVisible = NO ;
738741 }
739742}
740743
You can’t perform that action at this time.
0 commit comments