From 303a915053641e789dd0649f69f3f8c532f517c4 Mon Sep 17 00:00:00 2001 From: Mustafa Merza <mustafa.merza95@gmail.com> Date: Wed, 17 Jul 2024 17:28:43 +0300 Subject: [PATCH] - Moved handling some appearances to settings repository. --- .../Repositories/SettingsRepository.swift | 28 +++++++++++++++++-- .../Supporting Files/AppDelegate.swift | 1 - 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift b/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift index 9759223..21dec49 100644 --- a/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift +++ b/MiniScanner/Features/Common/Data/Repositories/SettingsRepository.swift @@ -85,12 +85,36 @@ extension SettingsRepository { extension SettingsRepository { - func handleColorScheme() { + private func handleColorScheme() { let colorScheme = getColorScheme() changeAppColorScheme(to: colorScheme) } - func handleUISettings() { + private func handleUISettings() { + handleNavigationBarAppearace() + handleToolBarAppearace() + + handleButtonAppearace() + } + + private func handleNavigationBarAppearace() { + let navigationBarAppearace = UINavigationBar.appearance() + + navigationBarAppearace.tintColor = .tintColor + navigationBarAppearace.barTintColor = .barTintColor + } + + private func handleToolBarAppearace() { + + let toolBarAppearace = UIToolbar.appearance() + + toolBarAppearace.tintColor = .tintColor + toolBarAppearace.barTintColor = .barTintColor + } + + private func handleButtonAppearace() { + let buttonAppearance = UIButton.appearance() + buttonAppearance.tintColor = .tintColor } } diff --git a/MiniScanner/Supporting Files/AppDelegate.swift b/MiniScanner/Supporting Files/AppDelegate.swift index 41a7694..70aded3 100644 --- a/MiniScanner/Supporting Files/AppDelegate.swift +++ b/MiniScanner/Supporting Files/AppDelegate.swift @@ -11,7 +11,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate { initializeDependencies() - ThemeManager.shared.setupTheme() if let savedFolders = UserDefaults.standard.object(forKey: "folders") as? Data { print("nooo!!") } else { -- GitLab