18

Main Interface is not changing with another storyboard in Xcode 11, it always run with Main.storyboard after changing with another storyboard, I have checked "is initial View Controller" after using a View Controller in new Storyboard.

I have tested in Xcode 10, it was working fine.

Did I miss something in Xcode 11?

enter image description here enter image description here enter image description here enter image description here In plist. enter image description here

Cœur
  • 37,241
  • 25
  • 195
  • 267
Abhishek Mitra
  • 3,335
  • 4
  • 25
  • 46

2 Answers2

66

Swift 5 with iOS 13

One more changes require in info.plist file under Application Scene Manifest group.

enter image description here

Change name in Application Scene Manifest also.

Additional:
If you want to create the root window without a storyboard, you need removing the Main storyboard file base name and Storyboard Name item from Info.plist, and create the window programmatically in SceneDelegate:

class SceneDelegate: UIResponder, UIWindowSceneDelegate {

    var window: UIWindow?

    @available(iOS 13.0, *)
    func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
        // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
        // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
        // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
        guard let windowScene = (scene as? UIWindowScene) else { return }
        window = UIWindow(windowScene: windowScene)
        // continue to create view controllers for window
    }

    //......
}
Pratik Sodha
  • 3,679
  • 2
  • 19
  • 38
  • is it possible to give something similar like $(PRODUCT_NAME) = bundle name, for storyboard name? – Midhun Narayan Feb 07 '20 at 05:58
  • 2
    I find it very frustrating that in order to change the main interface entry point there is literally 3 items to change within xcode in order for this to work. From the previous version of swift this "scene manifest" never existed... im sure apple has their reasons for adding in another required field to changed... but still frustrating ... way more complicated than it has to be – Julian Silvestri Feb 27 '20 at 15:23
  • What if I want to change it dynamically – chandru Jun 04 '20 at 08:38
  • What's the purpose of 2 entries in "Info.plist" file? Either it has to take the one in scene configuration or from the "Main storyboard file base name" – Satyam Jun 13 '20 at 07:52
  • Hello, what if I don't delete those 2 from info.plist? but I change the SceneDelegate. Would it be unsatisfying layout (not work as expected). – Farras Doko Aug 06 '20 at 13:25
  • @FarrasDoko Change in SceneDelegate works like a charm over ios13 and onwards. For below ios13 SceneDelegate not supported. – Pratik Sodha Aug 06 '20 at 17:51
1

Can you please change "Main storyboard file base name" to your storyboard file name.

tys
  • 25
  • 7
  • i didn't get you. – Abhishek Mitra Sep 24 '19 at 07:31
  • 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. – tys Sep 24 '19 at 07:32
  • By selecting storyboard from main interface, in plist, it automatically changed. though i have edited my question and added the screenshot of plist. – Abhishek Mitra Sep 24 '19 at 07:36