47 lines
1.4 KiB
Swift
47 lines
1.4 KiB
Swift
//
|
|
// 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])
|
|
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
|
|
|
|
let proxyTabBar = UITabBar.appearance()
|
|
proxyTabBar.tintColor = AppTheme.Colors.red
|
|
}
|
|
}
|