Skip to content

Instantly share code, notes, and snippets.

@Le0nX
Created November 1, 2019 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Le0nX/71e2667a71c9358e0e2b716a4aec944c to your computer and use it in GitHub Desktop.
Save Le0nX/71e2667a71c9358e0e2b716a4aec944c to your computer and use it in GitHub Desktop.
import Foundation
import UIKit
class ThemeManager {
// Some hack is needed in ios 13
// to make navigationBar color grey in largeTittle mode
static func setup() {
if #available(iOS 13.0, *) {
let navBarAppearance = UINavigationBarAppearance()
navBarAppearance.configureWithOpaqueBackground()
navBarAppearance.titleTextAttributes = [.foregroundColor: UIColor.white]
navBarAppearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
navBarAppearance.backgroundColor = UIColor.RGB(47,54,64)
UINavigationBar.appearance().standardAppearance = navBarAppearance
UINavigationBar.appearance().scrollEdgeAppearance = navBarAppearance
} else {
UINavigationBar.appearance().barTintColor = UIColor.RGB(47,54,64)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment