// // EQNAppearanceCommand.swift // Earthquake Network // // Created by Busi Andrea on 14/08/2020. // Copyright © 2020 Earthquake Network. All rights reserved. // import Foundation public class EQNAppearanceCommand: EQNCommandProtocol { // MARK: - Public func execute() { print("EQNAppearanceCommand: start execute") applyAppearance() } // MARK: - Private private func applyAppearance() { // UINavigationBar let proxyNavBar = UINavigationBar.appearance(whenContainedInInstancesOf: [UINavigationController.self]) if #available(iOS 13.0, *) { let navAppearance = UINavigationBarAppearance() navAppearance.configureWithOpaqueBackground() navAppearance.titleTextAttributes = [ NSAttributedString.Key.foregroundColor: AppTheme.Colors.darkGray ] navAppearance.largeTitleTextAttributes = [ NSAttributedString.Key.foregroundColor: AppTheme.Colors.darkGray ] navAppearance.backgroundColor = AppTheme.Colors.primary navAppearance.shadowColor = UIColor.clear proxyNavBar.isTranslucent = false proxyNavBar.tintColor = AppTheme.Colors.darkGray proxyNavBar.standardAppearance = navAppearance proxyNavBar.scrollEdgeAppearance = navAppearance } else { proxyNavBar.tintColor = AppTheme.Colors.darkGray proxyNavBar.isTranslucent = false proxyNavBar.barTintColor = AppTheme.Colors.primary proxyNavBar.titleTextAttributes = [ NSAttributedString.Key.foregroundColor: UIColor.white ] } let proxyTabBar = UITabBar.appearance() proxyTabBar.tintColor = AppTheme.Colors.red } }