0

Ever since Xcode 11 came out I have been trying to fix my app. There is something going on with the Status Bar + Navigation Bar and nothing I have been trying seems to be working and I can't seem to find any related issues either.

I have tried instantiating the Tab Bar Controller with less/more tabs. I tried changing the order. I tried using a navigation bar on the Tab Bar controller instead of the individual view controllers.

For some reason the first View Controller (root of a UINavigation Controller) in the Tab Bar Controller has no issues but when I change tabs, the navigation bar gets pushed up.

I added 2 screenshots to show what is going on. The first image shows the correct way the app is supposed to be and the second image shows the navigation bar being pushed into the status bar.

enter image description here

enter image description here

[UIView transitionFromView:self.window.rootViewController.view
                    toView:viewController.view
                  duration:0.55f
                   options: UIViewAnimationOptionTransitionCrossDissolve
                completion:^(BOOL finished){
                    self.window.rootViewController = viewController;

                }];
D34thSt4lker
  • 447
  • 1
  • 5
  • 12
  • 1
    If you want help, you must explain what _you_ are doing. You are the one making this happen somehow. But we don't know anything about your app, your view controllers, your segues, your code. Make a small example project that demonstrates the problem, and describe it or (better) post it for download. – matt Oct 06 '19 at 03:51
  • Share code of setting rootViewController. And did add any animations for tabController view appearance animation ? – Pratik Sodha Oct 06 '19 at 03:58
  • I'm not using any storyboards. I just set the tab bar controller as the window.root view controller with an array of navigation controllers, each with a root view controller. – D34thSt4lker Oct 06 '19 at 16:05
  • @matt I'm not even sure what's going on here. This was all fine before iOS 13 and xcode 11. As I said above, I am not using any storyboards for this project. I am programmatically setting everything. I thought maybe someone else has experienced a similar issue after the update – D34thSt4lker Oct 06 '19 at 16:08
  • "I am programmatically setting everything" Perfect! So show the code if you want help. That we can figure out whether you're "programmatically setting" something incorrectly. – matt Oct 06 '19 at 16:23
  • I'm out now but I'll post up my tab bar instantiation when I get to my computer. It's very basic stuff. – D34thSt4lker Oct 06 '19 at 16:53
  • @matt So I went to grab my code and paste it in here and then I looked back at what 'Pratik Sodha' said about "animations" and remembered I am using a UIVIew animation to transition from the login screen into the tab bar controller and I removed that transition and now the app seems to be showing the correct navigation bar height. I added the animation code above, is there something wrong with that? Thanks! – D34thSt4lker Oct 07 '19 at 04:33
  • Well, everything is wrong with it, actually. I've seen this "technique" for animating while changing the root view controller, but it's wrong. You actually shouldn't be changing the root view controller at all. Use a container view controller as the root view controller and perform a proper transition animation when you change its child. – matt Oct 07 '19 at 12:54
  • Ok... That's something I never picked up before. Not sure why this is the method I had been using but I must have seen it somewhere. – D34thSt4lker Oct 07 '19 at 18:04

1 Answers1

1

I noticed a change with transitionFromView in IOS 13 thats different from IOS 12. To see if this is your issue, try setting self.window.rootViewController = viewController; without the transition code block, and see if you still have the problem.

self.window.rootViewController = viewController;
/*
[UIView transitionFromView:self.window.rootViewController.view
                    toView:viewController.view
                  duration:0.55f
                   options: UIViewAnimationOptionTransitionCrossDissolve
                completion:^(BOOL finished){
                    self.window.rootViewController = viewController;

                }];
*/
dexyjones
  • 36
  • 3