Hopefully someone can point me in the right direction as I’m tearing my hair out with this one! I’m following the Handling User Input guide produced by Apple for SwiftUI. I’ve followed Chris’s video but I still can’t work out were I have gone wrong.
The app loads and build and appears to function correctly but my button to toggle the favorite status doesn’t save the change. I can see the state change on the location detail screen but when I return to the list view, the update of the isFavorite property hasn’t saved.
Has anyone else seen this issue? This is 20 minute guide apparantly and i’m on about 8 hours so far
I found the publishing and subscribing and bindings very confusing in the first place and then I am having am the same error you have plus the previews don’t like the environmentObject() anymore when I use the @ObservedObject instead of @EnvironmentObject in the userData declarations in List and Detail pages. So frustrating that Swift keeps changing their code.
Event declarations and triggers suck in any language. This reminds me of C#'s old way to declare an event and then you have to call a delegate at some point to pass along the data to the event call. Most complicated mess I ever did see.
I went through the apple documentation and made sure I had their exact code and now it works. I don’t completely understand how its working but its working now shrug