Skip to content
This repository was archived by the owner on Jan 14, 2018. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -560,22 +560,25 @@ - (CGFloat)resettedCenter
- (CGRect)fullViewBounds
{
CGFloat statusBarHeight = 0.0f;

BOOL legacyScreenHeightEnabled = NO;
if (floor(NSFoundationVersionNumber) <= 993.00) {
legacyScreenHeightEnabled = YES;
}

/**
Enable legacy screen height support if we are running on an SDK prior to iOS 6
and thus does not support the supportedInterfaceOrientationsForWindow: selector on
UIApplication, which was introduced in iOS 6
*/
UIApplication *sharedApplication = [UIApplication sharedApplication];
BOOL legacyScreenHeightEnabled = ![sharedApplication respondsToSelector:@selector(supportedInterfaceOrientationsForWindow:)];

if (self.shouldAdjustChildViewHeightForStatusBar || legacyScreenHeightEnabled) {
statusBarHeight = CGRectGetHeight([UIApplication sharedApplication].statusBarFrame);
if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
statusBarHeight = CGRectGetWidth([UIApplication sharedApplication].statusBarFrame);
statusBarHeight = sharedApplication.statusBarFrame.size.height;
if (UIInterfaceOrientationIsLandscape(sharedApplication.statusBarOrientation)) {
statusBarHeight = sharedApplication.statusBarFrame.size.width;
}
}

CGRect bounds = [UIScreen mainScreen].bounds;

if (UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
if (UIInterfaceOrientationIsLandscape(sharedApplication.statusBarOrientation)) {
CGFloat height = CGRectGetWidth(bounds);
CGFloat width = CGRectGetHeight(bounds);
bounds.size.height = height;
Expand Down