Skip to content

Commit 8324ee6

Browse files
author
Jean-Charles SORIN
committed
Fix fading OverlayView on dismiss
1 parent 2884581 commit 8324ee6

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

WYPopoverController/WYPopoverController.m

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2030,8 +2030,20 @@ - (void)dismissPopoverAnimated:(BOOL)aAnimated callDelegate:(BOOL)callDelegate
20302030

20312031
completionBlock = ^(BOOL finished) {
20322032

2033-
[overlayView removeFromSuperview];
2034-
overlayView = nil;
2033+
if (aAnimated)
2034+
{
2035+
[UIView animateWithDuration:WY_POPOVER_DEFAULT_ANIMATION_DURATION animations:^{
2036+
overlayView.alpha = 0;
2037+
} completion:^(BOOL finished) {
2038+
[overlayView removeFromSuperview];
2039+
overlayView = nil;
2040+
}];
2041+
}
2042+
else
2043+
{
2044+
[overlayView removeFromSuperview];
2045+
overlayView = nil;
2046+
}
20352047

20362048
if ([viewController isKindOfClass:[UINavigationController class]] == NO)
20372049
{

0 commit comments

Comments
 (0)