我在 Xcode 11 的 What's New 部分发现了这个术语.在 SwiftUI 的上下文中,这个术语到底是什么意思?
I found this term in the What's New section of Xcode 11. Exactly what is the meaning of this here in the context of SwiftUI?
SwiftUI 包括:设计工具读取和编写您为单一事实来源手动编辑的相同代码
SwiftUI includes: Design tools read and write the same code you edit by hand for a single source of truth
推荐答案使用 SwiftUI,您可以以编程方式编写代码或使用设计工具来编辑 UI,这也会导致 SwiftUI 代码被修改.本质上,您只有源代码,没有单独的设计文件(即 nib 或 Storyboard),这意味着您的 UI 设计和处理 UI 的代码不可能永远不同步(这是以前的情况nib 文件或故事板).
With SwiftUI, you can either write the code programatically or use the design tool to edit the UI, which will also result in the SwiftUI code being modified. Essentially, you only have the source code, there's no separate design file (i.e. nib or Storyboard), which means that there is no way your UI design and the code handling the UI can ever get out of sync (which was the case previously with nib files or storyboards).
更多推荐
在 SwiftUI 的上下文中,单一事实来源 (SSOT) 是什么意思?
发布评论