0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

複数のStoryboardを切り替えて起動する【XCode11版】

Posted at

複数のStoryboardを使用したい

習作を開発する際など、試してみたい機能によって複数の Storyboad を用意して、起動するStoryboard を切り替えて使いたいことがあります。

今までは、

  1. Storyboard を新規追加する
  2. Storyboard に ViewController を追加する
  3. ViewController の Attributes inspector で is initial View Controller にチェックを入れる
  4. プロジェクト設定の General タブで Deployment Info 内の Main Interface で起動したい Storybard を指定する

という方法で切り替えることが出来ました。

check.png

起動時のStoryboardの指定方法が変わった

ところが Xcode11 では上述の方法では切り替えることが出来なくなっています。
Xcode11 から UIScene という概念が導入された影響のようです。

Xcode11での指定方法

Xcode11では、1〜3までの Storyboard を用意するまでは同じですが、4の指定方法は以下のように変わりました。

  1. Storyboard を新規追加する
  2. Storyboard に ViewController を追加する
  3. ViewController の Attributes inspector で is initial View Controller にチェックを入れる
  4. Info.plist の Application Scene Manifest > Scene Configuration > Application Session Role > Item0 > Storyboard Name に起動したい Storyboard 名を指定する。
infoplist.png

参考

起動するStoryboardを変更する
SwiftUIを触って分かったこと:①初期画面の設定方法

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?