Snap to Item Scrolling in SwiftUI

Implement Snap to Item scrolling in SwiftUI using this custom ViewModifier technique. This quick tip shows how it can be implemented for horizontal stacks.

Jean-Marc Boullianne
Level Up Coding
Published in
2 min readAug 10, 2020

--

One of the biggest things I’m missing with SwiftUI is the ability to snap to views as I scroll in a ScrollView. Below is a technique I use to…

--

--