32.4 Working with Flexible GridItems
As previously discussed, if all of the GridItems contained in the array passed to a LazyVGrid view are declared as flexible, the number of GridItems in the array will dictate the number of columns included in the grid.
To see this in action, begin by editing the ContentView.swift file once again and declaring an array of three GridItems as follows:
struct ContentView: View {
private var colors: [Color] = [.blue, .yellow, .green]
private var gridItems = [GridItem(.flexible()),
GridItem(.flexible()),
...