123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- import Foundation
- 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()
- }
- }
|