diff options
author | Vitaly Takmazov | 2021-10-18 18:27:03 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2021-10-18 18:27:03 +0300 |
commit | 97253d60341018e1231043d673432c9c2a25c39c (patch) | |
tree | 5fa162a4a7c0c0c36ee2e1b632cd9936f9ebd4f9 /Juick/AppDelegate.m | |
parent | 52b37dfc0436da547140ffc739a0d462aa374bd0 (diff) |
iOS 15 updates
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 |