How Do I Set the Initial View Controller in Xcode 6?

   Posted December 8, 2014 by Lê Hoàng in Apple iPhone, Apple Mac

xcode-logo

Since the release of Xcode 6.2, the Is Initial View Controller has been removed from the Utilities panel. Here is the new way to set the initial view manually in Xcode.

In Xcode, the initial view controller is marked by the small arrow outside of the view. The arrow indicates the view/screen that users see first whenever they launch your app. Without the initial view controller, your app will just show a black screen at launch since it does not know which view to display.

2014-12-06_21-25-57

When you see the error perhaps the designated entry point is not set? in the debug area, it is very likely that you have not set the initial view controller. By default, Xcode sets the default view controller for you when you create a new project. However, when the storyboard is filled with too many views, the initial one may get accidentally deleted. When that accident happens, Xcode just removes the initial view configuration without switching to any other views in the storyboard.

2014-12-06_21-27-08

Previously, there was an option called Is Initial View Controller in the inspector panel that let you easily set the default view. However, the option has been removed from newer versions of Xcode.

2014-12-06_21-27-48

If you have had trouble finding the solution, here it is:

1. Open the Xcode project that you want to set as the initial view controller.

2. Open the desired storyboard file using the panel on the left side.

2014-12-06_21-36-32

3. As you select the storyboard, the main area displays all the views currently stored in the storyboard. Make sure that the one you are going to set as the initial view controller is visible on-screen.

4. Open the attribute panel (or right-hand side panel) if it is not visible. In the object library section, search for Storyboard Entry Point.

2014-12-06_21-28-25

5. Drag the entry point to the desired view, and you are done.

6. Press Command + R to run the app in the emulator, and verify that everything works as expected.

 

About Lê Hoàng

When not creating exciting new Android games, Lê Hoàng is here crafting tutorials, tweaks, and fixes for your enjoyment.
View more articles by Lê Hoàng

The Conversation

Follow the reactions below and share your own thoughts.