title: SwiftUI hasChanges always return true
body: <p>My code is as follows。The <strong>name</strong> in the data is not changed，but <strong>hasChanges</strong> always returned <strong>true</strong> ，Did I do something wrong? Thank you very much for your help ！</p>
  
  <pre class="lang-swift prettyprint-override"><code>struct SwiftUI: View {
    @Environment(\.managedObjectContext) var moc
    @Environment(\.presentationMode) var pre: Binding&lt;PresentationMode&gt;
    var data: CoreData
    @State private var name = ""
  
    var body: some View {
      NavigationView {
        HStack {
          TextField("name", text: self.$name)
        }.onAppear{
          self.name = self.data.name ?? ""
        }
  
        Button(action: dataSave) {
          HStack {
            Text("Done")
          }
        }
      }
    }
    func dataSave() {
      self.data.name = self.name
      if moc.hasChanges {
        do {
          try moc.save()
          self.pre.wrappedValue.dismiss()
        } catch { print(error.localizedDescription) }
      } else {
        self.pre.wrappedValue.dismiss()
      }
    }
  }
  </code></pre>
  
  <p>Why is it always returned true here?</p>
  
  <pre class="lang-swift prettyprint-override"><code>moc.hasChanges
  </code></pre>