Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 11.2.1 - Swift 5 - Can't change main storyboard "Main" to another storyboard "Start"

I have created a new storyboard named "Start.storyboard", but when I change Main Interface to "Start" nothing happened, The app just started with default storyboard "Main.storyboard". I'm using Xcode 11.2.1 and iOS 13.2.3

first image second image

Also I have tried to change the rootViewController from (AppDelegate) didFinishLaunchingWithOptions as the code below:

    let sb = UIStoryboard(name: "Start", bundle: nil)
    let vc = sb.instantiateViewController(withIdentifier: "PhoneVC")
    self.window?.rootViewController = vc

but I got the same result, Main storyboard can't be changed.

like image 467
Wafi AlShammari Avatar asked Dec 01 '19 06:12

Wafi AlShammari


People also ask

Can you have multiple storyboards Xcode?

Apple introduced them in iOS 9 and macOS 10.11. They do exactly what I needed. They allow you to break a storyboard up into multiple, smaller storyboards. A storyboard reference ties multiple storyboards together, creating one, large, composite storyboard.

Where is the main storyboard in Xcode 11?

there is a key in plist file and under "Targets" -> Custom iOS Target Properties "Main storyboard file base name". There default is "Main". So if you want any other storyboard, replace "Main" with your file name. By selecting storyboard from main interface, in plist, it automatically changed.


1 Answers

Go to Info.plist and update Application Scene Manifest. Change the storyboard name in default configuration of Application Session Role. Also make sure one of your ViewController in storyboard is marked as is Initial View Controller

enter image description here

like image 181
Bilal Avatar answered Oct 19 '22 10:10

Bilal