Thanks for providing this suggestion. This worked brilliantly in the Swift 5 language mode.
However, since migrating to Swift 6, this solution no longer works. A multitude of errors are thrown when using the solution you have provided in Swift 6.
Post
Replies
Boosts
Views
Activity
I have observed this too. I am on 15.1 Developer Beta 2, and while the UI updates when the property of a relationship that the object being presented changes, it updates after four or five explicit save calls. Not exactly useful in my case as I want the UI to update as soon as the update is received.
Ah I see. Well, thanks for your response. I guess we'll have to wait till the next Beta to see this issue resolved.
Based on my investigations, it seems that when I have relationships of any kind in SwiftData, the properties' getter methods are continuously fetching data. I don't know if your issues are caused by the same problem or something similar.