-
Notifications
You must be signed in to change notification settings - Fork 127
/
Copy pathAppAppearance.swift
executable file
·33 lines (29 loc) · 1.06 KB
/
AppAppearance.swift
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
32
33
//
// AppAppearance.swift
// App
//
// Created by Oleh on 23.09.18.
//
import Foundation
import UIKit
final class AppAppearance {
static func setupAppearance() {
if #available(iOS 15, *) {
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
appearance.backgroundColor = UIColor(red: 37/255.0, green: 37/255.0, blue: 37.0/255.0, alpha: 1.0)
UINavigationBar.appearance().standardAppearance = appearance
UINavigationBar.appearance().scrollEdgeAppearance = appearance
} else {
UINavigationBar.appearance().barTintColor = .black
UINavigationBar.appearance().tintColor = .white
UINavigationBar.appearance().titleTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
}
}
}
extension UINavigationController {
@objc override open var preferredStatusBarStyle: UIStatusBarStyle {
return .lightContent
}
}