12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- import UIKit
- class NCMainNavigationController: UINavigationController {
-
- private let appDelegate = UIApplication.shared.delegate as! AppDelegate
-
- required init?(coder: NSCoder) {
- super.init(coder: coder)
-
- if #available(iOS 13.0, *) {
-
- let appearance = UINavigationBarAppearance()
-
- appearance.configureWithOpaqueBackground()
- appearance.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.shared.label]
- appearance.backgroundColor = NCBrandColor.shared.systemBackground
- appearance.configureWithOpaqueBackground()
- appearance.titleTextAttributes = [NSAttributedString.Key.foregroundColor : NCBrandColor.shared.label]
- appearance.backgroundColor = NCBrandColor.shared.systemBackground
- navigationBar.scrollEdgeAppearance = appearance
- navigationBar.standardAppearance = appearance
-
- } else {
-
- navigationBar.barStyle = .default
- navigationBar.barTintColor = NCBrandColor.shared.systemBackground
- navigationBar.titleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.shared.label]
- navigationBar.largeTitleTextAttributes = [NSAttributedString.Key.foregroundColor:NCBrandColor.shared.label]
- }
-
- navigationBar.tintColor = .systemBlue
- navigationBar.setNeedsLayout()
- }
-
- override func viewDidLayoutSubviews() {
- super.viewDidLayoutSubviews()
- }
- }
|