what is onScrollGeometryChange

Generated on 8/2/2024

1 search

The onScrollGeometryChange modifier in SwiftUI allows you to performantly react to changes in the geometry of a scroll view. This includes reacting to changes in content offsets, content size, and more. For example, you can use it to detect when a view's visibility has changed due to scrolling, enabling you to create experiences centered around content moving on or off screen, such as auto-playing videos or showing a "back to top" button when you scroll past the top of the scroll view's contents.

For more details, you can refer to the session What’s new in SwiftUI at the timestamp 16:47.