{"data":{"allPost":{"edges":[{"node":{"slug":"/post/2023/03/adapting-reference-semantics-model-in-swiftui-the-basics-f521","title":"在 SwiftUI 中适配引用语义模型 -- 基础篇","subtitle":"","isPublished":true,"createdTime":"2023-03-02T00:00:00.000Z","lastModifiedTime":null,"license":null,"tags":["SwiftUI","Swift","适配器模式","引用语义","Binding"],"category":"Programming","file":{"childMdx":{"excerpt":"介绍 最近，我的一位同事试图将引用语义模型用  ObservableObject  和  @StateObject  迁移到 SwiftUI。由于网上有很多关于用这种方式来迁移引用语义模型到 SwiftUI 的例子，在这篇文章中我不打算重点讨论这种方法的一般情况，而是想重点讨论在我和我的同事寻找答案使其代码正常工作的过程中发现的更有价值的三个话题。这些话题是： 在 SwiftUI 中真相源 (Source of Truth) 是什么？ 在 SwiftUI…"}}}}]}},"pageContext":{"slug":"/zh-Hans/tag/引用语义","locale":{"identifier":"zh-Hans","slug":"/zh-Hans"},"title":"Tags > 引用语义","showsPageTitle":true,"keywords":["WeZZard","Pieces of My Soul"],"description":"","items":["50422053-00c8-522e-a118-2c12b7f4d13f"],"paginationInfo":{"basePath":"/zh-Hans/tag/引用语义","pageIndex":0,"pagesCount":1,"previousPageTitle":"Earlier Posts","nextPageTitle":"Later Posts"}}}