On iOS15 I was no longer able to set as black
UINavigationBar.appearance().tintColor = .white
UINavigationBar.appearance().barTintColor = UIColor(hexString: "#000000")
UINavigationBar.appearance().barStyle = UIBarStyle.black
I've fixed that with change
let appearance = UINavigationBarAppearance()
appearance.configureWithTransparentBackground()
appearance.backgroundColor = .black
appearance.titleTextAttributes = [.foregroundColor: UIColor.white]
appearance.largeTitleTextAttributes = [.foregroundColor: UIColor.white]
UINavigationBar.appearance().standardAppearance = appearance;
UINavigationBar.appearance().scrollEdgeAppearance = UINavigationBar.appearance().standardAppearance;
but now I have a problem with missing battery / clock icons