Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Created June 20, 2022 22:15
Show Gist options
  • Save sturdysturge/000d5d657c57f026081d2fb65374ac30 to your computer and use it in GitHub Desktop.
Save sturdysturge/000d5d657c57f026081d2fb65374ac30 to your computer and use it in GitHub Desktop.
import SwiftUI
@available(iOS 16.0, *)
struct ContentView: View {
let rows: [GridRowContent] = [
GridRowContent(items: ["A", "B", "C", "D", "E"]),
GridRowContent(items: ["F", "G", "H"]),
GridRowContent(items: ["I", "J", "K", "L", "M"])
]
var body: some View {
Grid {
ForEach(rows) { row in
GridRow {
ForEach(row.items) { item in
Text(item.text)
}
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment