My app crashes on iPhone/iPad Simulator when I'm using 2 ForEach in a LazyVStack. In the Canvas is works perfectly fine.
Error message is: 'Fatal error: each layout item may only occur once'
Minimum example:
If you change the LazyVStack with Vstack it work and if you delete one of the ForEach it work also on the simulator.
Error message is: 'Fatal error: each layout item may only occur once'
Minimum example:
Code Block swift struct ContentView: View { var body: some View { ScrollView { LazyVStack{ ForEach(0...2, id: \.self) { _ in Section { ForEach(0..<2, id: \.self) { idx in Text("Section Cell \(idx)") } } } } } } }
If you change the LazyVStack with Vstack it work and if you delete one of the ForEach it work also on the simulator.