Difference between view controller “use as launch

2019-09-20 17:57发布

问题:

I noticed there is a Use as Launch Screen option under File Inspector for a View Controller located in the Main.Storyboard. What is the difference between enabling the View Controller as a launch screen using this method and using the LaunchScreen.Storyboard that XCode provides? Similar questions are about the differences between Main.Storyboard and LaunchScreen.Storyboard but doesn't specifically ask about the Use as Launch Screen option.

回答1:

The difference is that LaunchScreen.storyboard has this option enabled by default, but you can:

  • create your own separate storyboard with an initial view controller,

  • then select it as the launch screen for your app inside the project's settings (Project settings/General/App Icons and Launch Images/Launch Screen file),

...and it will also work in the same way.

Xcode only puts the launch screen in a different storyboard to preserve an organized view structure.



标签: ios xcode