Ask Your Question
0

When using a for loop in SwiftUI, why does the index of my loop only return the value of 0 regardless of the interval in which it takes its value?

asked 2021-09-09 11:00:00 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-07-20 07:00:00 +0000

pufferfish gravatar image

This may be because you are initializing the index variable inside the for loop with a value of 0. Make sure that you are declaring the index variable outside of the loop and assigning it a value before the loop begins. Additionally, be sure to check that your loop is iterating over the correct range of values.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-09-09 11:00:00 +0000

Seen: 11 times

Last updated: Jul 20 '21