How to create a scrollable grid in SwiftUI using LazyHGrid

Federica Benacquista
1 min readMar 29, 2022

The above layout may seem pretty easy to achieve -and, trust me, it is. At first, however, I struggled a bit to get it right.

The symbols I’m using in this tutorial are SFSymbols.

I found two ways of achieving the above layout: using a LazyHGrid and using a HStack. Spoiler alert: the latter is the best BUT I’ll show you both anyway.

--

--

Federica Benacquista

I’m a self taught iOS developer and soon to be entrepreneur. I like to explain tricky concepts as easily as possible and it’s exactly what I do here.