How to add navigation interface after create a tab bar controller programmatically (Swift)

时光毁灭记忆、已成空白 提交于 2019-11-28 10:35:45

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()

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!