@@ -560,22 +560,25 @@ - (CGFloat)resettedCenter
560
560
- (CGRect)fullViewBounds
561
561
{
562
562
CGFloat statusBarHeight = 0 .0f ;
563
-
564
- BOOL legacyScreenHeightEnabled = NO ;
565
- if (floor (NSFoundationVersionNumber ) <= 993.00 ) {
566
- legacyScreenHeightEnabled = YES ;
567
- }
563
+
564
+ /* *
565
+ Enable legacy screen height support if we are running on an SDK prior to iOS 6
566
+ and thus does not support the supportedInterfaceOrientationsForWindow: selector on
567
+ UIApplication, which was introduced in iOS 6
568
+ */
569
+ UIApplication *sharedApplication = [UIApplication sharedApplication ];
570
+ BOOL legacyScreenHeightEnabled = ![sharedApplication respondsToSelector: @selector (supportedInterfaceOrientationsForWindow: )];
568
571
569
572
if (self.shouldAdjustChildViewHeightForStatusBar || legacyScreenHeightEnabled) {
570
- statusBarHeight = CGRectGetHeight ([UIApplication sharedApplication ] .statusBarFrame ) ;
571
- if (UIInterfaceOrientationIsLandscape ([UIApplication sharedApplication ] .statusBarOrientation )) {
572
- statusBarHeight = CGRectGetWidth ([UIApplication sharedApplication ] .statusBarFrame ) ;
573
+ statusBarHeight = sharedApplication.statusBarFrame . size . height ;
574
+ if (UIInterfaceOrientationIsLandscape (sharedApplication.statusBarOrientation )) {
575
+ statusBarHeight = sharedApplication.statusBarFrame . size . width ;
573
576
}
574
577
}
575
578
576
579
CGRect bounds = [UIScreen mainScreen ].bounds ;
577
580
578
- if (UIInterfaceOrientationIsLandscape ([UIApplication sharedApplication ] .statusBarOrientation )) {
581
+ if (UIInterfaceOrientationIsLandscape (sharedApplication.statusBarOrientation )) {
579
582
CGFloat height = CGRectGetWidth (bounds);
580
583
CGFloat width = CGRectGetHeight (bounds);
581
584
bounds.size .height = height;
0 commit comments