In my main UIViewController I am adding a homescreen view controller as subviews:
UINavigationController *controller = [[UINavigationController alloc] ini
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.
@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
}