Post

Replies

Boosts

Views

Activity

Reply to SwiftData and 'Circular references'
I ran into this today and this did work for me, however I also saw https://developer.apple.com/forums/thread/731921 where it seems simply deleting the "inverse" parameter out of the relationship also works. I haven't tried yet, but perhaps this will solve the automatic inverse relationships things? Example Code Main Entity: @Model final public class MainItem { var title: String @Relationship(inverse: \ChildItem.item) var childs: [ChildItem]? } Child Entity: @Model final public class ChildItem { var timestamp: Date // Add inverse as a simple variable @Relationship var item: MainItem? }
Jun ’23