Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions SCLAlertView/SCLAlertView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
}

Expand Down
Loading