我已经在StoryBoard中添加了一个NavigationController并将其设置为初始的viewController。 我该如何在appDelegate中访问NavigationController?从navigationController向appDelegate进行Ctrl-drag操作不会创建outlet。
我已经在StoryBoard中添加了一个NavigationController并将其设置为初始的viewController。 我该如何在appDelegate中访问NavigationController?从navigationController向appDelegate进行Ctrl-drag操作不会创建outlet。
在didFinishLaunchingWithOptions
方法中:
let navigationController = application.windows[0].rootViewController as! UINavigationController
SwiftControlsTest.ViewController
。 - Danny Bravo
let navigationController = self.window?.rootViewController as! UINavigationController
self.window.rootViewController
访问它。 - spassas