From 97253d60341018e1231043d673432c9c2a25c39c Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 18 Oct 2021 18:27:03 +0300 Subject: iOS 15 updates --- Juick/AppDelegate.m | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'Juick/AppDelegate.m') diff --git a/Juick/AppDelegate.m b/Juick/AppDelegate.m index aac90c7..cf2099a 100644 --- a/Juick/AppDelegate.m +++ b/Juick/AppDelegate.m @@ -42,8 +42,21 @@ self.sharedDateFormatter = [NSDateFormatter new]; self.sharedDateFormatter.dateFormat = @"yyyy-MM-dd HH:mm:ss"; [self.sharedDateFormatter setTimeZone:[NSTimeZone timeZoneWithName:@"UTC"]]; - [[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor colorNamed:@"Muted"]}]; - [[UINavigationBar appearance] setTranslucent:NO]; + NSDictionary *titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor colorNamed:@"Muted"]}; + if (@available(iOS 13.0, *)) { + UINavigationBarAppearance *appearance = [UINavigationBarAppearance new]; + [appearance configureWithOpaqueBackground]; + [appearance setTitleTextAttributes:titleTextAttributes]; + [UINavigationBar appearance].standardAppearance = appearance; + if (@available(iOS 15.0, *)) { + [UINavigationBar appearance].scrollEdgeAppearance = appearance; + } + } else { + [[UINavigationBar appearance] setTitleTextAttributes:titleTextAttributes]; + [[UINavigationBar appearance] setTranslucent:NO]; + } + + [[UITabBar appearance] setTintColor:[UIColor colorNamed:@"Title"]]; [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleDefault; #if !TARGET_IPHONE_SIMULATOR -- cgit v1.2.3