skip to Main Content

After updating Xcode I see the message in console:

[Assert] UINavigationBar decoded as unlocked for UINavigationController, or navigationBar delegate set up incorrectly. Inconsistent configuration may cause problems. 

And all the data I have in the Navigation Controller scenes are not displays.
I tried to place this to the SceneDelegate, but it wasn’t helpful:

self.window?.rootViewController = navigationVC 
self.window?.makeKeyAndVisible()

What should I do to fix this?

4

Answers


  1. I’m working on this bug too. I will update here if there is any progress. I’m also facing another exception:

    _UINavigationBarContentViewLayout valueForUndefinedKey:
    this class is not key value coding-compliant for the key inlineTitleView.
    

    It should be a bug in iOS 16, not related to the Xcode version.

    There are many others who have also encountered this problem: https://developer.apple.com/forums/thread/714278

    A temporary solution is to use code rather than storyboards to create the navigation controller.

    Login or Signup to reply.
  2. Restart Your Mac
    And remove unnecessary functions on main class

    Login or Signup to reply.
  3. I also find that problem.

    How I fix it

    If you use storyboards.

    Take the arrow( in Attribute inspector-> is initial view controller) from Navigation View Controller in the storyboard and put it in your next View Controller.

    Simplify change, initial view controller, in storyboard

    Login or Signup to reply.
  4. I create a blank app from template (for iOS). Embed the default view controller in UINavigationController. I have Xcode 14.2 & iOS 16.2 and then this appear in console:

    [Assert] UINavigationBar decoded as unlocked for
    UINavigationController, or navigationBar delegate set up incorrectly.
    Inconsistent configuration may cause problems.
    navigationController=<Swapi_People.MainNC: 0x107018a00>,
    navigationBar=<UINavigationBar: 0x105d0b0c0; frame = (0 59; 0 50);
    opaque = NO; autoresize = W; layer = <CALayer: 0x2825f0d60>>
    delegate=0x107018a00

    The root view controller display black or hidden maybe.

    I solve with this steps:

    1. Add new ViewController on Storyboard
    2. Create UIViewController class named for example: LoadingVC
    3. Set this class for the last inserted view controller
    4. Set the last inserted view controller as Entry Point (gray arrow)

    In LoadingVC add this code:

    import UIKit
    
    class LoadingVC: UIViewController {
    
        override func viewDidLoad() {
            super.viewDidLoad()
    
        }
    
        override func viewWillAppear(_ animated: Bool) {
            super.viewWillAppear(animated)
    
            /// I'm using R.swift but you can instantiate NavigationController manually here
            let nc = R.storyboard.main.mainNC()
            UIApplication.shared.windows.first?.rootViewController = nc
            UIApplication.shared.windows.first?.makeKeyAndVisible()
        }
    
    }
    

    Note: The log don’t disappear but at least root view controller display correctly.

    struct from Storyboard

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search