Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode how to change which viewController loads first at start-up

I am using storyboards, xcode 4.6.1. I have created an app, but now I want to go back and add a new view controller to the beginning. How do I assign this view controller to be the first one to load up at run-time?

like image 311
mablecable Avatar asked Apr 05 '13 17:04

mablecable


People also ask

How do I change the initial view controller in storyboard?

Specifying the Initial View ControllerOpen Main. storyboard and select the Tab Bar Controller Scene. On the right, select the Attribute inspector. You'll find a checkbox named Is Initial View Controller.

Which method is called first in ViewController?

The view controller calls its loadView method.


2 Answers

Choose your viewcontroller in storyboard , click show the attributes inspector

and choose initial scene: is initial view controller

enter image description here

like image 93
u.gen Avatar answered Oct 15 '22 08:10

u.gen


Initial View Controller

Initial View controller allows you to initiate storyboard without Storyboard ID

let storyboard = UIStoryboard(name: String(describing: SomeViewController.self), bundle: nil)
let initialViewController = storyboard.instantiateInitialViewController()

Xcode 10.3

Storyboard -> View Controller

Show Inspectors -> Show the Attributes inspector -> Is Initial View Controller

It will update the Initial view controller in the same .storyboard.

like image 45
yoAlex5 Avatar answered Oct 15 '22 07:10

yoAlex5