This repository was archived by the owner on Apr 27, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 99#import " CNPPopupController.h"
1010#import < QuartzCore/QuartzCore.h>
1111
12+ #define CNP_SYSTEM_VERSION_LESS_THAN (v ) ([[[UIDevice currentDevice ] systemVersion ] compare: v options: NSNumericSearch] == NSOrderedAscending)
1213#define CNP_IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
1314
1415typedef struct {
@@ -77,8 +78,10 @@ - (instancetype)initWithTitle:(NSAttributedString *)popupTitle
7778 }
7879 }
7980
80- [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (statusBarFrameOrOrientationChanged: ) name: UIApplicationDidChangeStatusBarOrientationNotification object: nil ];
81- [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (statusBarFrameOrOrientationChanged: ) name: UIApplicationDidChangeStatusBarFrameNotification object: nil ];
81+ if (CNP_SYSTEM_VERSION_LESS_THAN (@" 8.0" )) {
82+ [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (statusBarFrameOrOrientationChanged: ) name: UIApplicationDidChangeStatusBarOrientationNotification object: nil ];
83+ [[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (statusBarFrameOrOrientationChanged: ) name: UIApplicationDidChangeStatusBarFrameNotification object: nil ];
84+ }
8285 }
8386 return self;
8487}
@@ -245,7 +248,9 @@ - (void)presentPopupControllerAnimated:(BOOL)flag {
245248 // Safety Checks
246249 NSAssert (self.theme!=nil ,@" You must set a theme. You can use [CNPTheme defaultTheme] as a starting place" );
247250 [self setUpPopup ];
248- [self rotateAccordingToStatusBarOrientationAndSupportedOrientations ];
251+ if (CNP_SYSTEM_VERSION_LESS_THAN (@" 8.0" )) {
252+ [self rotateAccordingToStatusBarOrientationAndSupportedOrientations ];
253+ }
249254 [self setDismissedConstraints ];
250255 [self .maskView needsUpdateConstraints ];
251256 [self .maskView layoutIfNeeded ];
You can’t perform that action at this time.
0 commit comments