Skip to content

Commit

Permalink
Fixed an iOS 8 version check
Browse files Browse the repository at this point in the history
Testing if UIApplication responds to registerForRemoteNotifications is a really ugly way to check if we're running on iOS 8, when the code has nothing to do with remote notifications.

Just get the minimum dimension since a status bar will always be wider than it is tall.
  • Loading branch information
nicked committed Nov 5, 2014
1 parent ab7c657 commit 06bc3eb
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions Pod/Classes/TSMessage.m
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,7 @@ - (void)fadeInCurrentNotification
}

CGSize statusBarSize = [UIApplication sharedApplication].statusBarFrame.size;

if ([[UIApplication sharedApplication] respondsToSelector:@selector(registerForRemoteNotifications)]) {
verticalOffset += statusBarSize.height;
} else {
BOOL isPortrait = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]);
CGFloat offset = isPortrait ? statusBarSize.height : statusBarSize.width;
verticalOffset += offset;
}
verticalOffset += MIN(statusBarSize.width, statusBarSize.height);
};

if ([currentView.viewController isKindOfClass:[UINavigationController class]] || [currentView.viewController.parentViewController isKindOfClass:[UINavigationController class]])
Expand Down

0 comments on commit 06bc3eb

Please sign in to comment.