-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAppearance.swift
More file actions
31 lines (27 loc) · 1.15 KB
/
Appearance.swift
File metadata and controls
31 lines (27 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import UIKit
struct Appearance {
static func configure() {
configureNavigationBar()
configureTabBar()
}
private static func configureNavigationBar() {
let navigationBarAppearance = UINavigationBarAppearance()
navigationBarAppearance.configureWithDefaultBackground()
UINavigationBar.appearance().standardAppearance = navigationBarAppearance
UINavigationBar.appearance().scrollEdgeAppearance = navigationBarAppearance
UINavigationBar.appearance().isOpaque = false
UINavigationBar.appearance().isTranslucent = true
navigationBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.black]
}
private static func configureTabBar() {
let tabBarAppearance = UITabBarAppearance()
tabBarAppearance.configureWithDefaultBackground()
tabBarAppearance.backgroundColor = UIColor.white
UITabBar.appearance().standardAppearance = tabBarAppearance
UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance
UITabBar.appearance().isOpaque = true
UITabBar.appearance().isTranslucent = false
UITabBar.appearance().tintColor = .red
UITabBar.appearance().unselectedItemTintColor = .black
}
}