title: Why is an ObservedObject array not updated in my SwiftUI application?
body: <p>I'm playing with SwiftUI, trying to understand how <code>ObservableObject</code> works. I have an array of <code>Person</code> objects. When I add a new <code>Person</code> into the array, it is reloaded in my View, however if I change the value of an existing <code>Person</code>, it is not reloaded in the View.</p>
  <pre><code>//  NamesClass.swift
  import Foundation
  import SwiftUI
  import Combine
  
  class Person: ObservableObject,Identifiable{
      var id: Int
      @Published var name: String
      
      init(id: Int, name: String){
          self.id = id
          self.name = name
      }
  }
  
  class People: ObservableObject{
      @Published var people: [Person]
      
      init(){
          self.people = [
              Person(id: 1, name:&quot;Javier&quot;),
              Person(id: 2, name:&quot;Juan&quot;),
              Person(id: 3, name:&quot;Pedro&quot;),
              Person(id: 4, name:&quot;Luis&quot;)]
      }
  }
  </code></pre>
  <pre><code>struct ContentView: View {
      @ObservedObject var mypeople: People
      
      var body: some View {
          VStack{
              ForEach(mypeople.people){ person in
                  Text(&quot;\(person.name)&quot;)
              }
              Button(action: {
                  self.mypeople.people[0].name=&quot;Jaime&quot;
                  //self.mypeople.people.append(Person(id: 5, name: &quot;John&quot;))
              }) {
                  Text(&quot;Add/Change name&quot;)
              }
          }
      }
  }
  </code></pre>
  <p>If I uncomment the line to add a new <code>Person</code> (John), the name of Jaime is shown properly, however if I just change the name this is not shown in the View.</p>
  <p>I'm afraid I'm doing something wrong or maybe I don't get how the <code>ObservedObjects</code> work with arrays.</p>