Working on a sample app. The goal is to have a list pulled up from CoreData in a Master, and then click on one to go to a detail, where you can edit the information and sav
As promised, here is a link to sample SwiftUI program that uses CoreData. The current version compiles and runs on the GM release. It does not use the new @FetchRequest property wrapper because it does not suit all of my needs. I wrote a CoreDataDataSource class that does basically the same thing plus a lot more.
https://github.com/Whiffer/SwiftUI-Core-Data-Test
As @trapper explained, the entityName
has to be bound the the MasterView
.
Updates are reflected when you add @ObservedObject
in the DetailView
as follows:
@ObservedObject var entityName:EntityName
You need to bind the entity in DetailView to the entity passed in from MasterView. Declare it like @Binding var entityName: EntityName