Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Swift: How do I get access to the navigationController in AppDelegate

I have added a NavigationController in the StoryBoard and made it the initial viewController. How do I get access to the NavigationController in the appDelegate. Ctrl-drag from navigationController to AppDelegate does not create an outlet.

like image 301
RawMean Avatar asked Jul 31 '14 08:07

RawMean


People also ask

How do I change the navigation root view controller in Swift?

Go to the Project Navigator → info. plist file → Application Scene Manifest property → Scene Configuration → item 0 and get rid of the property Storyboard Name by clicking the icon that has a minus in the circle next to it.


1 Answers

In didFinishLaunchingWithOptions:

let navigationController = application.windows[0].rootViewController as! UINavigationController
like image 116
zisoft Avatar answered Oct 18 '22 20:10

zisoft