【发布时间】:2016-01-04 06:14:21
【问题描述】:
我试图让我的应用程序打开到一个特定的 ViewController,该 ViewController 深深嵌入在导航控制器中,但不是 RootViewController。我已经尝试在应用程序委托 didFinishLaunchingWithOptions 添加:
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewController = storyboard.instantiateViewControllerWithIdentifier("NavViewController")
self.window?.rootViewController = initialViewController
self.window?.makeKeyAndVisible()
但这会转到根视图控制器。我尝试将此行更改为:
storyboard.instantiateViewControllerWithIdentifier("MainViewController")
这确实打开到正确的视图控制器,但顶部没有导航栏,需要在应用程序中导航。
【问题讨论】:
标签: xcode swift uinavigationcontroller appdelegate