New in SwiftUI 4: Grid View
SwiftUI 4 brought in a new container view called Grid
view. A Grid
is a container view which gives us a two-dimensional layout by arranging its child views in rows and columns.
We create a layout by initializing Grid
with a collection of GridRows
. Let’s create an example to understand better:
struct ContentView: View {
var body: some View {
VStack {
Grid {…