TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Thoughts on SwiftData as a Framework?

1 pointsby mkchoi212over 1 year ago
I have been using SwiftData for about 3-4 months and it&#x27;s been... interesting. I am confused about some of the decisions Apple made when building the framework. Particularly, why is dealing with multiple model contexts so difficult? Even with autosaving on, I found that deleting an object in a separate model context - one that isn&#x27;t the main context - doesn&#x27;t get reflected on the main context. In addition, I haven&#x27;t been able to find a mechanism that guarantees all contexts are on the same page. If this is the case, are we supposed to be making all critical changes on the main context?<p>Also, what about ModelActors? If you can&#x27;t pass the main context into a model actor, how can you use ModelActors and be confident that you are making changes based on a database state that has no pending changes?

no comments

no comments