diff --git a/SCLAlertView/SCLAlertView.m b/SCLAlertView/SCLAlertView.m index d23146a..5c7db95 100755 --- a/SCLAlertView/SCLAlertView.m +++ b/SCLAlertView/SCLAlertView.m @@ -721,6 +721,8 @@ - (void)keyboardWillHide:(NSNotification *)notification NSTimeInterval animationDuration = [userInfo[UIKeyboardAnimationDurationUserInfoKey] doubleValue]; UIViewAnimationOptions animationCurve = [userInfo[UIKeyboardAnimationCurveUserInfoKey] unsignedIntegerValue] << 16; + _keyboardIsVisible = NO; + [UIView animateWithDuration:animationDuration delay:0 options:animationCurve animations:^{ CGRect contentFrame = self.contentView.frame; contentFrame.origin.y = self->_tmpContentViewFrameOrigin.y; @@ -730,11 +732,12 @@ - (void)keyboardWillHide:(NSNotification *)notification circleFrame.origin.y = self->_tmpCircleViewFrameOrigin.y; self.circleViewBackground.frame = circleFrame; } completion:^(BOOL finished) { - self->_tmpContentViewFrameOrigin = CGPointZero; - self->_tmpCircleViewFrameOrigin = CGPointZero; + // Only reset if keyboard hasn't been shown again during the animation + if (!self->_keyboardIsVisible) { + self->_tmpContentViewFrameOrigin = CGPointZero; + self->_tmpCircleViewFrameOrigin = CGPointZero; + } }]; - - _keyboardIsVisible = NO; } }