0Pricing
SwiftUI Academy · Lesson

ScrollView Reader & Anchors

Scroll to specific items programmatically.

Jumping to Content

Sometimes you need to scroll to a specific item in code, like a Back to Top button. ScrollViewReader makes that possible. 🎯

Wrap the ScrollView

Place a ScrollViewReader around your ScrollView; it hands you a proxy you use to control scrolling.

ScrollViewReader { proxy in
    ScrollView {
        Content()
    }
}

All lessons in this course

  1. Horizontal & Vertical ScrollView
  2. LazyVStack & LazyHStack
  3. Adaptive Grids with LazyVGrid
  4. ScrollView Reader & Anchors
← Back to SwiftUI Academy