How to change the default View Controller that is loaded when app launches?

NSExplorer picture NSExplorer · Feb 2, 2011 · Viewed 11.1k times · Source

I have an application, say 'MyApp', which by default loads the view controller 'MyAppViewController' whenever the application launches. Later, I added a new view controller 'NewViewControler' to the project.

I now want the 'NewViewController' to be my default view controller which loads when the app launches.

Please let me know what changes I need to make in my project to achieve this.

Answer

Pepe Ramirez picture Pepe Ramirez · Sep 24, 2012

Its easy, just:

  • Open your Storyboard
  • Click on the View Controller corresponding to the view that you want to be the initial view
  • Open the Attributes Inspector
  • Select the "Is Initial View Controller" check box in the View Controller section