askvity

How to Create a Storyboard Entry Point

Published in App Entry Point 4 mins read

To create a storyboard entry point, you need to select a View Controller scene within your storyboard and mark it as the initial view controller using the Attribute Inspector.

In iOS development, a storyboard entry point is the initial scene that is loaded and displayed when your application starts using a particular storyboard. Setting this entry point is crucial for defining the starting screen of your app or a specific section of your app managed by that storyboard.

Understanding the Initial View Controller

Every storyboard that serves as an application's primary interface or a starting point for a specific flow needs one designated Initial View Controller. This controller is the first scene the system instantiates and presents when the storyboard is loaded.

Steps to Set the Initial View Controller

Setting the entry point is a straightforward process within Xcode's Interface Builder. Based on standard iOS development practices, including the method described in the reference, here's how you do it:

  1. Open your Storyboard: Navigate to the .storyboard file you want to configure in your Xcode project navigator.
  2. Select the Target Scene: In the storyboard canvas, click on the View Controller scene you want to set as the entry point. This could be any type of view controller, such as a standard UIViewController, a UINavigationController, a UITabBarController, or a custom subclass. The reference specifically mentions selecting a "Tab Bar Controller Scene" as an example.
  3. Access the Attribute Inspector: With the View Controller scene selected, open the Attribute Inspector (the fourth tab from the left in the right-hand Utility panel). This inspector contains various properties for the selected object.
  4. Check "Is Initial View Controller": Within the Attribute Inspector, locate the section related to the View Controller properties. You will find a checkbox labeled "Is Initial View Controller". Check this box. According to the reference, "Checking this box will identify the selected view controller as the initial entry point for the storyboard you're on."

Once checked, you will see an arrow appear on the left edge of the selected View Controller scene in the storyboard canvas. This arrow visually indicates that this scene is the designated entry point for the storyboard.

Why Set an Entry Point?

  • App Launch: Determines the very first screen users see when they open the application.
  • Flow Start: Defines where a specific user flow begins, especially in apps using multiple storyboards.
  • Debugging: Provides a clear starting point when testing specific parts of your application.

Example Scenario

Imagine your app uses a main Main.storyboard. You might have a login screen (LoginViewController), a main dashboard (DashboardViewController), and a settings screen (SettingsViewController). To make the login screen the first thing the user sees upon opening the app, you would select the LoginViewController scene in Main.storyboard and check its "Is Initial View Controller" checkbox in the Attribute Inspector.

Summary Table

Action Location/Tool Visual Indicator (after check)
Select View Controller Scene Storyboard Canvas N/A
Open Attribute Inspector Right-hand Utility Panel N/A
Check "Is Initial View Controller" Attribute Inspector (VC section) Arrow on scene's left edge

Setting the initial view controller is a fundamental step in configuring your storyboard-based application interface.

Related Articles