ForEach looping in SwifUI

Photo by Cafer Mert Ceyhan on Unsplash

In the Hacking with Swift 100 days to code challenges, we used the ForEach() method in our Guess the flag game.

ForEach is a view that allows us to create other views in a loop. It seems the most important reason of using a ForEach is to bypass the ten-child limit that SwiftUI imposes. This is because your ForEach view becomes one of…