swiftui update

This commit is contained in:
John O'Reilly 2021-06-17 19:17:58 +01:00
parent cdff8bfebf
commit e8060a2160

View file

@ -25,20 +25,17 @@ struct PeopleListView: View {
var body: some View {
NavigationView {
VStack {
List(viewModel.people, id: \.name) { person in
NavigationLink(destination: PersonDetailsView(viewModel: viewModel, person: person)) {
PersonView(viewModel: viewModel, person: person)
}
}
.navigationBarTitle(Text("People In Space"))
.onAppear {
viewModel.startObservingPeopleUpdates()
}.onDisappear {
viewModel.stopObservingPeopleUpdates()
List(viewModel.people, id: \.name) { person in
NavigationLink(destination: PersonDetailsView(viewModel: viewModel, person: person)) {
PersonView(viewModel: viewModel, person: person)
}
}
.navigationBarTitle(Text("People In Space"))
.onAppear {
viewModel.startObservingPeopleUpdates()
}.onDisappear {
viewModel.stopObservingPeopleUpdates()
}
}
}
}