@@ -1613,6 +1613,7 @@ - (void)presentPopoverFromRect:(CGRect)aRect
16131613 {
16141614 if ((options & WYPopoverAnimationOptionFade) == WYPopoverAnimationOptionFade)
16151615 {
1616+ overlayView.alpha = 0 ;
16161617 containerView.alpha = 0 ;
16171618 }
16181619
@@ -1626,6 +1627,8 @@ - (void)presentPopoverFromRect:(CGRect)aRect
16261627 }
16271628
16281629 [UIView animateWithDuration: WY_POPOVER_DEFAULT_ANIMATION_DURATION animations: ^{
1630+ overlayView.alpha = 1 ;
1631+ overlayView.transform = CGAffineTransformIdentity;
16291632 containerView.alpha = 1 ;
16301633 containerView.transform = CGAffineTransformIdentity;
16311634 } completion: ^(BOOL finished) {
@@ -2027,8 +2030,20 @@ - (void)dismissPopoverAnimated:(BOOL)aAnimated callDelegate:(BOOL)callDelegate
20272030
20282031 completionBlock = ^(BOOL finished) {
20292032
2030- [overlayView removeFromSuperview ];
2031- 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+ }
20322047
20332048 if ([viewController isKindOfClass: [UINavigationController class ]] == NO )
20342049 {
@@ -2285,9 +2300,7 @@ - (CGSize)sizeForRect:(CGRect)aRect
22852300
22862301#pragma mark Inline functions
22872302
2288- #pragma clang diagnostic push
2289- #pragma clang diagnostic ignored "-Wunused-variable"
2290-
2303+ /*
22912304static NSString* NSStringFromOrientation(NSInteger orientation) {
22922305 NSString* result = @"Unknown";
22932306
@@ -2310,8 +2323,7 @@ - (CGSize)sizeForRect:(CGRect)aRect
23102323
23112324 return result;
23122325}
2313-
2314- #pragma clang diagnostic pop
2326+ */
23152327
23162328static CGFloat GetStatusBarHeight () {
23172329 UIInterfaceOrientation orienation = [[UIApplication sharedApplication ] statusBarOrientation ];
0 commit comments