Posts

Post marked as solved
8 Replies
I have this issue too. Very frustrating. I've ended up creating a subclass af UINavigationController that sets the barTintColoer whenever the trait collection changes. It's not pretty, but does the job until Apple fixes it at their end.class DarkModeAwareNavigationController: UINavigationController { override init(rootViewController: UIViewController) { super.init(rootViewController: rootViewController) self.updateBarTintColor() } required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.updateBarTintColor() } override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { super.traitCollectionDidChange(previousTraitCollection) self.updateBarTintColor() } private func updateBarTintColor() { if #available(iOS 13.0, *) { self.navigationBar.barTintColor = UITraitCollection.current.userInterfaceStyle == .dark ? .black : .white } } }