What is Nostr?
frederik_diamond / FREDERIK DIAMOND
npub1nj0…2gqz
2025-04-23 18:36:46

frederik_diamond on Nostr: I got it working. Turns out the problem was with nested value types not triggering ...

I got it working.
Turns out the problem was with nested value types not triggering view updates.
Now I am working with folder IDs instead of passing around entire folder objects.
Before I was working with copies of the folder array, not the original. I am now creating a complete copy of the folders array and replacing it entirely when changes happen. So now SwiftUI knows when to update the UI.

It sure did take some time to fix. I’ll need to do some more testing to make sure it 100% works. But my solution seems very promising 🤞 #dev #swift

I think I have screwed up with my state management in my Swift notes app.

I can’t get a view to update immediately. Every time a change happens, the user must go back and forth between views before the change is reflected in the UI.

Done some research, and it seems like my problem is a classic Swift problem known as “the nested Observable Objects issue”. #swift #dev
Author Public Key
npub1nj0crmtetu84a7j43yegy358mp8u0e4ye7ndkhtd8dg0edll4mpqn52gqz