ForEach row display
Use Lazy*Grid
, e.g. LazyVGrid
.
Example:
struct ContentView: View {
private let columns = [
GridItem(.flexible()),
GridItem(.flexible())
]
var body: some View {
LazyVGrid(columns: columns) {
ForEach(1 ... 5, id: \.self) { number in
Text(String(number))
}
}
}
}
Result: