Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Popping ViewController doesn't call viewWillAppear when going back

Whenever I pop a view controller manually, viewWillAppear doesn't get called on the previous UIViewController that now appears.

These are 2 regular UIViewControllers. My application setup is like this:

- UINavigationController
   - UITabViewController with 5 UIViewControllers including UIViewControllerA
      -UIViewControllerA (When I get back here, viewWillAppear doesnt get called)
        -UIViewControllerB (I'm here, I want to pop to A)

I've tried calling viewWillAppear manually, but that doesn't help either. What could be wrong? My last resort will be popping B, and A, and then creating a new A, and pushing that, but that's only as a last resort(I assume this will work?)

like image 842
Henley Avatar asked Oct 10 '22 09:10

Henley


1 Answers

You cannot have a UITabBarController "inside" of a UINavigationController. That's probably why some of the viewWillAppear methods aren't being called. Take a look here: Tab bar controller inside a navigation controller, or sharing a navigation root view

like image 94
Daniel Dickison Avatar answered Oct 13 '22 01:10

Daniel Dickison