title: Handling lists with CoreData in SwiftUI
body: <p>I started using CoreData with SwiftUI. After following this <a href="https://www.hackingwithswift.com/quick-start/swiftui/introduction-to-using-core-data-with-swiftui" rel="nofollow noreferrer">series of tutorials</a>. And I can already read an write data to CoreData.</p>
  <p>But things are still fuzzy when I need to handle lists.
  I now have code like this:</p>
  <pre><code>var body: some View {
      VStack {
          List(self.myList.keys.sorted(), id: \.self) { location in
              HStack {
                  Spacer()
                  Button(action: {
                      self.showingList.toggle()
                      .....
                  }) {
                      Text(location)
                          .font(.largeTitle)
                          .foregroundColor(.secondary)
                  }
                  Spacer()
              }
          }
      }
  
      .....
  }
  </code></pre>
  <p>Here myList is just a dictionary, which I previously loaded from some Core Data entity.</p>
  <p>What I want to do now is to have my Core Data DB to be synchronized with my list, when I remove items from the list or change (or add) some elements. I presume that should be easy if I do the right thing using the proper SwiftUI wrapper, but I need to find some clear tutorial for that. Any recommendation would be useful.</p>