iOS Quick Tip: Setting the default view controller on a storyboard

Figuring out how to set the default view controller on a storyboard is surprisingly unintuitive, especially as someone new to iOS development. It seemed logical to me that it would be some sort of setting on the storyboard itself. However, it’s actually the exact opposite – it’s a setting on the view controller.

This is somewhat bizzare as it means setting a property on one view controller can affect other view controllers, but nevertheless, it’s quite simple. Here’s what you need to do:

  • Open your storyboard
  • Click on the view controller corresponding to the view that you want to be the default view
  • Open the Attributes Inspector
  • Check the Is Initial View Controller check box in the View Controller section

Voila! Your view controller is now the default view controller for this storyboard.

2 Comments

  1. Thank you! I was going crazy trying to figure this out. Your solution still works the same in Xcode 9.3.1. I got to the View Controller by clicking the blue box icon at the top of the new storyboard. The checkbox “is initial Controller” then appears near the top of the Attributes Inspector.

    Reply

Leave a Reply to sushrut Cancel reply

Your email address will not be published. Required fields are marked *