swiftui update
This commit is contained in:
parent
cdff8bfebf
commit
e8060a2160
1 changed files with 9 additions and 12 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue