SWIFT
if #available(iOS 15.0, *){
let appearance = UINavigationBarAppearance()
appearance.configureWithOpaqueBackground()
appearance.backgroundColor = UIColor.init(hex: "#302F32")
appearance.titleTextAttributes = [NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 18), NSAttributedString.Key.foregroundColor: UIColor.white]
self.navigationController?.navigationBar.standardAppearance = appearance
self.navigationController?.navigationBar.scrollEdgeAppearance = self.navigationController?.navigationBar.standardAppearance
} else{
self.navigationController?.navigationBar.setBackgroundImage(UIImage.init(color: UIColor.init(hex: "#302F32")), for: .default)
self.navigationController?.navigationBar.isTranslucent = false
let dict:NSDictionary = [NSAttributedString.Key.foregroundColor: UIColor.white,NSAttributedString.Key.font : UIFont.boldSystemFont(ofSize: 18)]
self.navigationController?.navigationBar.titleTextAttributes = dict as? [NSAttributedString.Key : Any]
}