viewDidAppear not getting called

后端 未结 8 975
醉酒成梦
醉酒成梦 2021-01-12 00:17

In my main UIViewController I am adding a homescreen view controller as subviews:

   UINavigationController *controller = [[UINavigationController alloc] ini         


        
相关标签:
8条回答
  • 2021-01-12 00:41

    My problem was that I was changing the tab in UITabBarController (selectedIndex = x) and then messing with the child view controllers in that tab. The problem is that it needs to be done the other way round: first mess with the child view controllers in other tab and then change the tab by setting the selectedIndex. After this change methods viewWillAppear/viewDidAppear begun to be called correctly.

    0 讨论(0)
  • 2021-01-12 00:42

    @Rob answer in Swift 4 (which helped me on my case which I was adding a childViewController to a UITabBarController)

    override var shouldAutomaticallyForwardAppearanceMethods: Bool {
        return true
    }
    
    0 讨论(0)
提交回复
热议问题