Xcode 14 UINavigationBar issue - swift

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?

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.

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

Restart Your Mac
And remove unnecessary functions on main class

Related

unrefactor storyboards in xcode

I have a big storyboard in xcode and by mistake I have refactored some of my view controllers into a new storyboard. Is it possible to unrefector those view controllers to the original storyboard? I can't undo cause it doesn't work.
I have searched around but it seemed nothing is available. Or it is not possible?
Regards
Xcode doesn't have a unrefactor function from what i know.
However, you can actually just mouse drag over all the ViewControllers in your new storyboard and just copy paste it back to your original storyboard. The segue from one ViewController to another should still remain.
The only extra step you have to do is - manually revert the segue from pointing to new storyboard to the correct ViewController.

Can't connect Outlet

I don't know what happen with my xcode. Im my controller view only have 3 outlets, but interface builder found 5 outlets. My app always crash in runtime.
Problem caused by previously setted outlet been deleted improperly. You can easily fix this problem by deleting invalid outlet from the storyBoard and also, I can see another issue from your screenshot.You have a breakPoint running on your namePromotionalLabel.Hope this help...
This is what you should do:
Remove all connections from button
Add all connections again, after that your app shouldn't show SIGNAL SIGABRT(which I think it does) anymore
Remove all the outlets from the Outlet section in the above screenshot and then try again to draw and outlet.
if still it cause a problem then create a new swift controller file for that view controller and assign the class to that view controller
I think this is so basic but almost people don't mention this.
The problem is view outlet have to connect to main view too.
Almost cases, it's connected automatically.

iPad Bug using storyboard with uipageviewcontroller and navigation controller

I have a bug in my code that I hope some can help me with.
I have a UIPageViewController in my storyboard and I am also using a UINavigation Controller. When my segue is run which connects one view to switch to the uipageview the viewdidload method gets called on the uipageviewcontroller twice.
Weird thing is it only happens on the iPad the same code on the iPhone only gets called once. Does anyone know why that would happen?
Seems to have been a bug in iOS. When I updated my OS the problem was fixed.

XCODE 5 - Storyboard Segues Push vs Modal

I am currently learning iOS development and I began with a simple Tabbed Application. It has the default First and Second View in it. I added a TableView with static cells content. I then added another View Controller. I created a Segue using the storyboard. When I set the transition to modal, it works fine. When I set it to push, the app is crashing (Uncaught exception).
Any idea why?
How can I get more information regarding the exception? Can I make the app stops when it encounters an exception?
Figured it out.. I need to add a Navigation Controller to use push...

iPad : two-stage method implementation

here is my problem, I hope someone can help me.
My iPad app is made like this : I have several viewControllers added as tabs in a tabBarController added to window in my appDelegate. In each of these viewControllers I got two navigationControllers with one viewController in.
Appdelegate
TabBarController
viewController
navigationController
viewController
navigationController
viewController
viewController
navigationController
viewController
navigationController
viewController
Everything work fine in simulator but when I run it on device I got this warning :
Using two-stage rotation animation. To use the smoother single-stage animation, this application must remove two-stage method implementations.
It only happen when I run it on a device in landscape mode. The first navigationController of the default view shown by the tabBarController take all the screen width (not important here but it's to explain that this warning makes my layout going crazy). In portrait nothing is traced in the console.
I read many things about this message but I can't find any solution to make it go away.
I'm sure it's a story of shouldAutoRotate or something like this.
I also notice that if i remove the tabBarController and simply add my first viewController to window, the message is not shown.
Very strange... please help :)
I think you should rely on the standard UISplitViewController available under iPad. This controller is what is used under the Settings app and various other apps.
If you do not feel comfortable with such a tool, you can take a look at the APSplitViewController plugin developed by slatvick on GitHub. This could solve a lot of your problems, I hope.
Edit
Googling about this issue, I found out that this warning appears when you create a wrong hierarchy of view controllers. In this case, you are pushing two navigation controllers inside a view controller, even if a view controller is not meant to contain different navigation controller. Probably there could be a problem related on how you send up to the parent view controller methods like viewDidLoad or viewWillLoad: etc. You should try to understand if you are passing all these call correctly to the parent view controller from the inner navigation controllers.