How do I add a navigation interface programmatically on Swift after I created a TabBarController
on AppDelegate/didFinishLaunchingWithOpt
To create a navigation controller use:
var navigationController = UINavigationController(rootViewController: viewController));
Then just put it in the array:
tabBarController.viewControllers = [purchaseViewController, financeViewController, navigationController]
But, you can to add UIControls to navigation bar only after view controller did load. On applicationDidFinishLaunching:
it's impossible, because the navigationBar is nil. Proper way is to add controls to navigationBar in the viewDidLoad()