SwiftUI List View not updating after Core Data entity updated in another View

前端 未结 1 1725
北海茫月
北海茫月 2021-01-24 14:53

I have a Lesson entity stored in Core Data one of whose variables is to store whether the lesson is complete.

The lessons are listed in a SwiftUI list and when selected

相关标签:
1条回答
  • 2021-01-24 15:29

    Yes, the way I solved this in the end was by adding @ObservedObject to the stored object in the PhonicIntroGame : View. As follows -

    @ObservedObject var lesson: Lesson
    
    0 讨论(0)
提交回复
热议问题