From 06bc3eb75b014cb03c056bbd506159d81e53d418 Mon Sep 17 00:00:00 2001 From: nicked Date: Wed, 5 Nov 2014 12:52:45 +0100 Subject: [PATCH] Fixed an iOS 8 version check 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. --- Pod/Classes/TSMessage.m | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/Pod/Classes/TSMessage.m b/Pod/Classes/TSMessage.m index c36cdfc8..5c4d530b 100755 --- a/Pod/Classes/TSMessage.m +++ b/Pod/Classes/TSMessage.m @@ -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]])