Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
472 views
in Technique[技术] by (71.8m points)

swift - xCode 11.2.1-Swift 5-无法将主故事板“ Main”更改为另一个故事板“ Start”(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".

(我创建了一个名为“ Start.storyboard”的新情节提要,但是当我将主界面更改为“开始”时,什么都没发生,该应用程序仅从默认情节提要“ Main.storyboard”启动。)

I'm using xCode 11.2.1 and iOS 13.2.3

(我正在使用xCode 11.2.1和iOS 13.2.3)

第一张图片 第二张图片

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

(我也试图从(AppDelegate)didFinishLaunchingWithOptions更改rootViewController为以下代码:)

    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.

(但我得到了相同的结果,无法更改主情节提要。)

  ask by Wafi AlShammari translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Go to Info.plist and update Application Scene Manifest .

(转到Info.plist并更新“ Application Scene Manifest 。)

Change the storyboard name in default configuration of Application Session Role .

(在“ Application Session Role默认配置中更改情节提要名称。)

Also make sure one of your ViewController in storyboard is marked as is Initial View Controller

(还要确保情节提要中的一个ViewController被标记为is Initial View Controller)

在此处输入图片说明


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...