在 SwiftUI 的上下文中,单一事实来源 (SSOT) 是什么意思? [英] What is the meaning of Single Source of Truth (SSOT) in the context of SwiftUI?

查看:28
本文介绍了在 SwiftUI 的上下文中,单一事实来源 (SSOT) 是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 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) 是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆