Instance Method

instantiateInitialViewController()

Instantiates and returns the initial view controller in the view controller graph.

Declaration

func instantiateInitialViewController() -> UIViewController?

Return Value

The initial view controller in the storyboard.

Discussion

Every storyboard file must have an initial view controller that represents the starting point for the corresponding user interface. For an application’s storyboard, this is usually the first screen presented to the user at launch time. You designate the initial view controller in Interface Builder when configuring the storyboard file.

Typically, you use this method only when transitioning to the initial view controller in a different storyboard file. For your application’s main storyboard file—that is, the storyboard file specified in the application’s Info.plist file using the UIMainStoryboardFile key—the initial view controller is loaded and presented automatically.

This method creates a new instance of the initial view controller each time you call it.

See Also

Instantiating Storyboard View Controllers

func instantiateViewController(withIdentifier: String)

Instantiates and returns the view controller with the specified identifier.