Skip to content

Commit 2f23421

Browse files
fix issue #59
1 parent 71c18b3 commit 2f23421

3 files changed

Lines changed: 20 additions & 9 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ A brief summary of each WYPopoverController release can be found on the [wiki](h
280280

281281
* [@mikl_jeo](https://twitter.com/mikl_jeo) on Twitter
282282
* [@nicolaschengdev](https://github.com/nicolaschengdev) on Github
283-
* <a href="mailTo:nicolas.cheng.dev@gmail.com">nicolas.cheng.dev [at] gmail [dot] com</a>
284283

285284
### License
286285

WYPopoverController/WYPopoverController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ typedef NS_OPTIONS(NSUInteger, WYPopoverAnimationOptions) {
8888

8989
////////////////////////////////////////////////////////////////////////////////////////////////////////
9090

91-
@interface WYPopoverController : NSObject
91+
@interface WYPopoverController : NSObject <UIAppearanceContainer>
9292

9393
@property (nonatomic, weak) id <WYPopoverControllerDelegate> delegate;
9494

WYPopoverController/WYPopoverController.m

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
/*
22912304
static 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

23162328
static CGFloat GetStatusBarHeight() {
23172329
UIInterfaceOrientation orienation = [[UIApplication sharedApplication] statusBarOrientation];

0 commit comments

Comments
 (0)