Understanding Grids in SwiftUI for iOS 14

Mohammad Azam
The Startup
Published in
4 min readJun 28, 2020

--

Thanks to Glenn Carstens-Peters for sharing their work on Unsplash.

SwiftUI was announced at WWDC 2019 and it paved a way for declarative programming for building interfaces. SwiftUI Grid comes in two different flavours, which includes LazyVGrid and LazyHGrid. As the name suggest, LazyVGrid is a Grid that flows in vertical direction and the LazyHGrid flows in horizontal direction.

If you are interested in videos then check out the following videos associated with this post.

Each Grid consists of GridItem, which dictates the structure of the cell displayed in the grid. GridItem can be fixed, flexible or adaptive. Let’s start with the fixed size GridItems.

Fixed GridItems

--

--

Mohammad Azam
The Startup

Lead instructor at a coding bootcamp. Top iOS mobile instructor on Udemy. Author of multiple books and international speaker. azamsharp.school