What are some scrollview changes since WW23

Asked on 12/31/2024

1 search

Since WWDC 2023, there have been several changes to ScrollView in SwiftUI, as highlighted in the sessions from WWDC 2024:

  1. Programmatic Control: You now have more programmatic control over your ScrollView, including the ability to scroll to more positions like the top edge. This allows for a more customized scrolling experience.

  2. Scroll Positions and Alignment: There are new options for controlling content alignment and scroll positions, such as turning off bouncing along a given axis and programmatically stopping scrolling.

  3. Visibility and Geometry Changes: New modifiers like onScrollVisibilityChange and onScrollGeometryChange allow you to react to changes in content visibility and geometry, enabling experiences like auto-playing videos when content moves on or off the screen.

  4. Custom Scroll Effects: The scrollTransition modifier can be used to create unique scroll effects, such as parallax effects, by manipulating content based on scroll values.

  5. View Modifiers in tvOS 18: Specific to tvOS 18, new view modifiers for ScrollView allow for actions like removing a background image when a header section scrolls off-screen.

For more detailed information, you can refer to the session What’s new in SwiftUI (16:18) and Create custom visual effects with SwiftUI (01:29).