02
Apr
2021
ScrollViewReader + onChange = Responsive Tabs
swiftui scrollview scrollviewreader onchangedReading time: 2 min
This recipe shows how to combine ScrollViewReader
and onChange(of:perform:)
to jump to the selected item in a scrollable view. We'll use this method to update our top tabs and make them fully visible when selected.
Search our recipes
Check out the companion apps!
Our free companion app and XCode Extension brings 100+ SwiftUI recipes right at your fingertips! Get a preview of it in the Online Companion.
Have a recipe for us?
Get in touch and let's grow the cookbook together!