“Main storyboard file base name” 在 Info.plist 中的作用是什么?

huangapple go评论64阅读模式
英文:

Purpose of "Main storyboard file base name" in Info.plist?

问题

在标准的iOS项目中,Info.plist 中包含一个名为 Main storyboard file base name 的条目。鉴于视图控制器可以通过场景委托(或从应用委托内部)通过一个故事板对象来实例化,是否有理由存在这个条目而不是删除它呢?(保留它的一个想法可能是性能或兼容性?)

英文:

In standard iOS projects, there is an entry in Info.plist that includes Main storyboard file base name. Given that view controllers can be instantiated through a storyboard object within a SceneDelegate (or from within AppDelegate) is there a reason for this entry to exist vs. deleting this entry? (one thought to keep it would be performance or compatibility?)

“Main storyboard file base name” 在 Info.plist 中的作用是什么?

答案1

得分: 1

"Main storyboard file base name" 是在场景之前的时代存在的。它指定了您应用程序的用户界面的主要故事板。该主要故事板的初始视图控制器会在应用程序启动时自动显示。如果您的应用程序完全不使用场景,并且您的应用程序使用故事板,那么仍然需要此值。

如果您完全支持场景和 Info.plist 的场景清单部分,那么“Main storyboard file base name” 就不再必要,因为场景清单指定了每个场景的主要故事板。

如果您不使用故事板(例如,纯代码的 UIKit 或 SwiftUI),那么“Main storyboard file base name” 就不再必要。实际上,一个新的 SwiftUI 项目默认不会包含此条目。

默认的 iOS 基于故事板的项目仍然会包含此条目,同时将默认的场景清单设置为相同的故事板。我认为这只是在使用场景之前的剩余内容。

英文:

"Main storyboard file base name" is from the days before scenes. It specified the main storyboard of your app's user interface. The initial view controller of that main storyboard is what is shown automatically on app launch. You still need this value if your app fully opts out of scenes and your app uses storyboards.

If you fully support scenes and the scene manifest section of Info.plist then "Main storyboard file base name" isn't necessary since the scene manifest specifies each scene's main storyboard.

If you don't use storyboards (such as code-only UIKit or SwiftUI) then "Main storyboard file base name" isn't necessary. In fact, a new SwiftUI project will not have this entry by default.

Default iOS Storyboard-based projects still include this entry in addition to setting the default scene manifest to the same storyboard. I think it's just a leftover from the pre-scene days.

huangapple
  • 本文由 发表于 2023年1月9日 09:22:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75052435.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定