From 41fa6f2b3eb87f8466187758ce321d1ae7347225 Mon Sep 17 00:00:00 2001 From: CMK Date: Thu, 17 Jun 2021 14:30:24 +0800 Subject: [PATCH] fix: set barButtonItem and tabBarItem tint color to brand blue --- .../HashtagTimeline/HashtagTimelineViewController.swift | 2 +- .../Scene/HomeTimeline/HomeTimelineViewController.swift | 4 ++-- Mastodon/Scene/MainTab/MainTabBarController.swift | 8 +++++--- Mastodon/Supporting Files/AppDelegate.swift | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewController.swift b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewController.swift index 17284210..7c7e8a27 100644 --- a/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewController.swift +++ b/Mastodon/Scene/HashtagTimeline/HashtagTimelineViewController.swift @@ -24,7 +24,7 @@ class HashtagTimelineViewController: UIViewController, NeedsDependency, MediaPre let composeBarButtonItem: UIBarButtonItem = { let barButtonItem = UIBarButtonItem() - barButtonItem.tintColor = Asset.Colors.Label.highlight.color + barButtonItem.tintColor = Asset.Colors.brandBlue.color barButtonItem.image = UIImage(systemName: "square.and.pencil")?.withRenderingMode(.alwaysTemplate) return barButtonItem }() diff --git a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift index bb6a651b..b293c7e5 100644 --- a/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift +++ b/Mastodon/Scene/HomeTimeline/HomeTimelineViewController.swift @@ -38,14 +38,14 @@ final class HomeTimelineViewController: UIViewController, NeedsDependency, Media let settingBarButtonItem: UIBarButtonItem = { let barButtonItem = UIBarButtonItem() - barButtonItem.tintColor = Asset.Colors.Label.highlight.color + barButtonItem.tintColor = Asset.Colors.brandBlue.color barButtonItem.image = UIImage(systemName: "gear")?.withRenderingMode(.alwaysTemplate) return barButtonItem }() let composeBarButtonItem: UIBarButtonItem = { let barButtonItem = UIBarButtonItem() - barButtonItem.tintColor = Asset.Colors.Label.highlight.color + barButtonItem.tintColor = Asset.Colors.brandBlue.color barButtonItem.image = UIImage(systemName: "square.and.pencil")?.withRenderingMode(.alwaysTemplate) return barButtonItem }() diff --git a/Mastodon/Scene/MainTab/MainTabBarController.swift b/Mastodon/Scene/MainTab/MainTabBarController.swift index 2df0cdf3..cd56e08c 100644 --- a/Mastodon/Scene/MainTab/MainTabBarController.swift +++ b/Mastodon/Scene/MainTab/MainTabBarController.swift @@ -106,9 +106,11 @@ extension MainTabBarController { selectedIndex = 0 // TODO: custom accent color -// let tabBarAppearance = UITabBarAppearance() -// tabBarAppearance.configureWithDefaultBackground() -// tabBar.standardAppearance = tabBarAppearance + let tabBarAppearance = UITabBarAppearance() + tabBarAppearance.configureWithDefaultBackground() + tabBarAppearance.selectionIndicatorTintColor = Asset.Colors.brandBlue.color + tabBar.standardAppearance = tabBarAppearance + context.apiService.error .receive(on: DispatchQueue.main) diff --git a/Mastodon/Supporting Files/AppDelegate.swift b/Mastodon/Supporting Files/AppDelegate.swift index 6c49638d..9b084649 100644 --- a/Mastodon/Supporting Files/AppDelegate.swift +++ b/Mastodon/Supporting Files/AppDelegate.swift @@ -23,6 +23,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate { UserDefaults.standard.setValue(UIApplication.appVersion(), forKey: "Mastodon.appVersion") UserDefaults.standard.setValue(UIApplication.appBuild(), forKey: "Mastodon.appBundle") + // Setup notification UNUserNotificationCenter.current().delegate = self application.registerForRemoteNotifications()