How would this work if View1 looked like this:
struct View1: View{
var body: some View{
LazyVGrid(columns: gridLayout, spacing: 10) {
ForEach(Array(person.item! as! Set<Item>).sorted { $0.date! > $1.date! }, id: \.self) { (item: Item) in
NavigationLink(destination: View2(){
Text("Navigate")
}
}
}
}
}
I can't get it to compile properly if the if self.KeepView2 is right before the NavigationLink. And if I put it before the LazyVGrid, it won't display the contents of the ForEach Array. Thanks!