Why an ObservedObject array is not updated in my SwiftUI application? : <p>I'm playing with SwitUI, trying to understand how ObservableObject works. I have an array of Person objects. When I add a new Person into the array, it is reloaded in my View. However, if I change the value of an existing Person, 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:"Javier"),
            Person(id: 2, name:"Juan"),
            Person(id: 3, name:"Pedro"),
            Person(id: 4, name:"Luis")]
    }

}
</code></pre>

<pre><code>struct ContentView: View {
    @ObservedObject var mypeople: People

    var body: some View {
        VStack{
            ForEach(mypeople.people){ person in
                Text("\(person.name)")
            }
            Button(action: {
                self.mypeople.people[0].name="Jaime"
                //self.mypeople.people.append(Person(id: 5, name: "John"))
            }) {
                Text("Add/Change name")
            }
        }
    }
}
</code></pre>

<p>If I uncomment the line to add a new Person (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 ObservedObjects work with Arrays.</p>

<p>Any help or explanation is welcome!</p>
