diff options
Diffstat (limited to 'Juick/AppDelegate.m')
-rw-r--r-- | Juick/AppDelegate.m | 17 |
1 files changed, 15 insertions, 2 deletions
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 |