Scrumdinger ScrumsView doesn't update after editing the details of a scrum

Im following Apple's tutorial for creating an app for managing scrums and Im currently on the "Passing data with bindings chapter" (https://developer.apple.com/tutorials/app-dev-training/passing-data-with-bindings). My problem is that, after editing the details of a scrum, the DetailView and the ScrumsView don't update to show the changes. Ive downloaded the project files and am looking at the complete folder and Im still getting the same issue.

I was able to get the DetailView to show changes by converting the DailyScrum struct into a class but ScrumsView still doesn't update. Am I missing something or is Apple's solution broken?

Please let me know if I need to upload anything else. Thanks

Answered by darkpaw in 750267022

Did you change your own code back to a struct and change the func update into mutating func update?

If you're seeing the same issue, delete the app from the Simulator and try again.

I just downloaded the project files from the link you provided, opened the 'Complete' folder, opened the project, made zero code changes, ran it on an iPhone 14 Pro in the Simulator, and it works fine.

The only difference I can see in your files is in the DailyScrum.swift model. Change it back to a struct, and check that line 45 is a mutating func rather than just a func.

Without it being a mutating func you aren't able to change the data in the struct, which is likely the reason for your issue.

I tried your suggestion, darkpaw, and downloaded the files again, made sure not to change anything, and used the same simulator but the issues remain. If I edit the scrum name or theme and click 'done', DetailView no longer updates to reflect the changes.

Accepted Answer

Did you change your own code back to a struct and change the func update into mutating func update?

If you're seeing the same issue, delete the app from the Simulator and try again.

Scrumdinger ScrumsView doesn't update after editing the details of a scrum
 
 
Q