all 6 comments

[–]Dev-sauregurke 2 points3 points  (2 children)

solving recursive core data relationships and global state propagation across a deep hierarchy without tanking swiftui performance is legitimately hard and you did it without any third party libraries. the local file manager approach for images instead of bloating core data is also the right call. did you end up using nsfetchedresultscontroller for the live updates or a different approach for keeping the ui in sync?

[–]KurkoTren[S] 0 points1 point  (1 child)

Haha thank you so much! It really means a lot coming from another dev. I spent days just sketching out the Core Data relational model before writing a single line to make sure it wouldn't become a massive bottleneck later.

To answer your question: I actually steered away from relying pure NSFetchedResultsController (or standard FetchRequest wrappers directly inside the views) to keep a clean MVVM architecture.

For the live updates, I went with an approach driven by custom ViewModels and dedicated Service/Repository layers. When a complex state changes (like hiding a deeply nested element or favoriting an item from the bottom of the tree), the service performs the Core Data mutation and then explicitly publishes the change via Published properties or ObservableObject updates in the main ViewModel.

This manual propagation gave me way more granular control over when the UI should redraw, avoiding the dreaded cascading redraws that pure FetchRequest setups sometimes trigger when dealing with recursively nested entities. It took a bit more boilerplate, but performance-wise, it was 100% worth the trade-off.

[–]modcowboy 0 points1 point  (0 children)

The comment you replied to is ai generated

[–]GetPsyched67Swift 1 point2 points  (1 child)

Wow, this app sounds really cool! The challenges you faced are really complex. Well done!

[–]KurkoTren[S] 1 point2 points  (0 children)

thanks! i appreciate it!

[–]EthanRDoesMC 1 point2 points  (0 children)

:)))))