I'm completely stumped on this problem.
I have an app whose view controllers are mostly made on the storyboard. However, there are a few that are made entirely with code (programmatically).
The entry point for my app is a TabBarController that feeds in to many different Navigation Controllers, each with its own UIViewController.
Here is a visual representation:
I have no problem navigating to any of the proper view controllers (who are represented in the storyboard) using the Tab Bar Items. However, when I choose a Tab Bar Item that does not have a direct segue on the storyboard - because its UIViewController is built entirely through code - I cannot segue to the proper class.
I've added a *.swift class to the NavigationController that has a ViewDidLoad() function. This function is NEVER called when I choose the appropriate Tab Bar Item. The strange part is that there is a single Navigation Controller that is connected to a UIViewController (displayed in the storyboard) and has a *.swift file attached to it. Its ViewDidLoad() does get called when the proper Tab Bar Item is selected. I've tried to attach multiple *.swift files (all inheriting from UINavigationController) but I cannot get a single one to call the appropriate ViewDidLoad() function.
Edit: As you can see in the image, the bottom left Navigation Controller does not have a segue extending from it. However, there is a class attached to it and inside its ViewDidLoad() function is where the segue takes place
class WeaponsNavController: UINavigationController
{
override func viewDidLoad()
{
self.navigationController?.pushViewController(WeaponsTableVC(), animated: true)
}
}
As you can see, I'm trying to connect to the WeaponsTableVC() which is a view controller created entirely through code. However, this class does not seem to get called at all despite being directly connected to the Navigation Controller in the storyboard.