From 30d5a48967bed1ffd26ac571523883ce495f0e8d Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sun, 10 Nov 2013 08:44:01 +0400 Subject: iOS 6.1 partial support --- Juick/AppDelegate.m | 9 +++++---- Juick/Juick-Prefix.pch | 2 ++ Juick/MessageCell.m | 6 ++++-- Juick/MessagesViewController.m | 18 ++++++++++-------- 4 files changed, 21 insertions(+), 14 deletions(-) (limited to 'Juick') diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index 292ef7f..2853cfd 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -18,10 +18,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // style the navigation bar - [[UINavigationBar appearance] setBarTintColor:[ColorsAndButtons navbarBackground]]; - [[UINavigationBar appearance] setTintColor:[ColorsAndButtons navbarFont]]; - [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorsAndButtons navbarFont]}]; - + if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) { + [[UINavigationBar appearance] setBarTintColor:[ColorsAndButtons navbarBackground]]; + [[UINavigationBar appearance] setTintColor:[ColorsAndButtons navbarFont]]; + [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [ColorsAndButtons navbarFont]}]; + } // make the status bar white [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; diff --git a/Juick/Juick-Prefix.pch b/Juick/Juick-Prefix.pch index 3db364c..1bd0628 100644 --- a/Juick/Juick-Prefix.pch +++ b/Juick/Juick-Prefix.pch @@ -13,5 +13,7 @@ #ifdef __OBJC__ #import #import + #import + #import #define MAS_SHORTHAND #endif diff --git a/Juick/MessageCell.m b/Juick/MessageCell.m index 48ddb36..c37a3bd 100644 --- a/Juick/MessageCell.m +++ b/Juick/MessageCell.m @@ -91,8 +91,10 @@ - (void)updateFonts { - self.titleLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; - self.bodyLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; + if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) { + self.titleLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleHeadline]; + self.bodyLabel.font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; + } } - (void) attributedLabel:(TTTAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url { diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m index fa53875..68c70cb 100644 --- a/Juick/MessagesViewController.m +++ b/Juick/MessagesViewController.m @@ -117,20 +117,22 @@ static NSString *CellIdentifier = @"MessageCell"; - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; - - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(contentSizeCategoryChanged:) + if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) { + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(contentSizeCategoryChanged:) name:UIContentSizeCategoryDidChangeNotification - object:nil]; + object:nil]; + } } - (void)viewDidDisappear:(BOOL)animated { [super viewDidDisappear:animated]; - - [[NSNotificationCenter defaultCenter] removeObserver:self - name:UIContentSizeCategoryDidChangeNotification - object:nil]; + if (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) { + [[NSNotificationCenter defaultCenter] removeObserver:self + name:UIContentSizeCategoryDidChangeNotification + object:nil]; + } } - (void)didReceiveMemoryWarning -- cgit v1.2.3