I have a root view that shows up when I first start my app. The root view has a button that when pressed opens another view controller that should have a nav bar at the top with an (add) navigation item. The problem is when I set the root view as the root view in app delegate, my other controller (that opens from a button) fails to show the nav bar with the nav item.
Heres what I mean:
When App Delegate is set to
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.main.bounds)
window?.makeKeyAndVisible()
let firstviewController = FirstViewController()
let navController = UINavigationController(rootViewController: firstviewController)
let core = CoreViewController()
window?.rootViewController = navController
return true
}
The navigation controls and navbar all show up but the CoreViewController (the view with the button) fails to show up first as the root controller.
How can first view controller keep its NavControls while have CoreViewController launch first as the root screen?
View Controller with Button
When View Controller is a Nav Controller