title: Detail View is not updated when the model is updated (Using List) SwiftUI
body: <p>I am using <strong>List</strong> to show the models in the main view. When I update the model in detail view it is not updated in detail view.</p>
  <p>When I don't use <code>List</code>, detail view is updated. What am I missing for <code>List</code>?</p>
  <hr />
  <pre><code>struct Person: Identifiable {
    var id: UUID
    var name: String
  }
  
  class PersonModel: ObservableObject {
    @Published var persons: [Person] = [Person(id: UUID(), name: &quot;Ege&quot;)]
  }
  
  struct PersonListView: View {
    
    @StateObject private var personModel = PersonModel()
    
    var body: some View {
      NavigationView {
        List {
          ForEach(personModel.persons) { person in
            NavigationLink(destination: PersonDetailView(person: person).environmentObject(personModel)) {
              Text(person.name)
            }
          }
        }
        .navigationTitle(&quot;Persons&quot;)
      }
    }
  }
  
  struct PersonDetailView: View {
    
    let person: Person
    @EnvironmentObject var personModel: PersonModel
    
    var body: some View {
      VStack {
        Text(person.name)
        
        Button(action: {
          let personIndex = personModel.persons.firstIndex(where: { $0.id == person.id })!
          personModel.persons[personIndex].name = &quot;Updated Name&quot;
        }) {
          Text(&quot;Update&quot;)
        }
      }
      .navigationTitle(&quot;Person Detail&quot;)
    }
  }
  </code></pre>
  <p>Workarounds that I used for List:</p>
  <ul>
  <li>Using custom binding function for NavigationLink.</li>
  </ul>
  <p>Example code:</p>
  <pre><code>//1
  private func binding(for person: Person) -&gt; Binding&lt;Person&gt; {
    let personIndex = personModel.persons.firstIndex(where: { $0.id == person.id }) ?? 0
    return $personModel.persons[personIndex]
  }
  //2
  NavigationLink(destination: PersonDetailView(person: binding(for: person)))
  //3
  @Binding var person: Person //DetailView
  </code></pre>
  <ul>
  <li>Using another <code>@State</code> in detail view which is initialized with passed
  model in onAppear method.</li>
  </ul>