problem with ForEach loop

when I'm using for each loop(using repeat command) instead of printing 5 items it is printing 10 times, it always doubles my command

it is my code

NavigationView {

            ScrollView {

                ScrollView(.horizontal , showsIndicators: false){

                    HStack(spacing: -10){

                        ForEach(0..<5) { item in

                            NavigationLink(destination: DetailView()) {

                                CardView()

                            CardView()

Answered by Claude31 in 723001022

Why do you call CardView twice ?

Accepted Answer

Why do you call CardView twice ?

Oh its my mistake thanks❤️

problem with ForEach loop
 
 
Q