Search code examples
iosswiftuinavigationcontrolleruinavigationbarios14

NavigationBar color is broken in IOS 14


I am facing this problem in only one my app and only happens in IOS 14. I didn't change anything but if I install same app to previous version of IOS, app works correctly.

My problem is when I push to another ViewController Navigation Bar color flashing to black or white. It is same when I pop to previous page.

This is the code when I call to go to AViewController:

let storyboard = UIStoryboard(name: "Login", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "AViewController")
let nvc = UINavigationController(rootViewController: vc)
nvc.navigationBar.shadowImage = UIImage()
nvc.navigationBar.barStyle = .default
nvc.navigationBar.isTranslucent = false
nvc.navigationBar.barTintColor = UIColor.red
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.window!.rootViewController = nvc
// If I rootViewController or use push it is solid black, if I use present it is transperent white
// If present: nvc.modalPresentationStyle = .overFullScreen
// If present: self.present(nvc, animated: true, completion: nil)

This is the code when I call when push to BViewController:

let storyboard = UIStoryboard(name: "Login", bundle: nil)
let vc = storyboard.instantiateViewController(withIdentifier: "BViewController")
self.navigationController?.pushViewController(vc, animated: true)

Please help me. Does anyone facing same issue in IOS 14? Screenshots below;

AViewController

When Pushing to BViewController

BViewController


Solution

  • Problem caused because of this 3rd party framework:

    'KMNavigationBarTransition', '=1.1.5'

    Older versions of this have iOS 14 issiues. To fix it I removed it in my project. Latest version change logs says they have a fix for iOS 14 but I never tried it.