What changes are there with ScrollView in SwiftUI
Asked on 08/02/2024
1 search
Changes to ScrollView in SwiftUI
Several enhancements have been made to ScrollView
in SwiftUI, providing developers with more control and flexibility:
- Programmatic Control: You now have more programmatic control over your scroll views, including the ability to scroll to more positions like the top edge.
- Scroll Positions: There are additional scroll positions you can programmatically scroll to, enhancing navigation within the scroll view.
- Content Alignment: You can control the alignment of your content more precisely.
- Scroll Behavior: New options allow you to turn off bouncing along a given axis and programmatically stop scrolling.
- Visibility Detection: The
onScrollVisibilityChange
modifier lets you detect when a view's visibility changes due to scrolling, enabling dynamic UI updates based on scroll position. - Scroll Transitions: The
scrollTransition
modifier allows for custom transitions based on the scroll position, enabling effects like rotation, offset changes, and parallax effects. - Geometry Changes: The
onScrollGeometryChange
modifier lets you react to changes in content offsets, content size, and more, providing a deeper level of integration with the scroll view's state.
For more details, you can refer to the following sessions:
Relevant Sessions

Get started with HealthKit in visionOS
Discover how to use HealthKit to create experiences that take full advantage of the spatial canvas. Learn the capabilities of HealthKit on the platform, find out how to bring an existing iPadOS app to visionOS, and explore the special considerations governing HealthKit during a Guest User session. You’ll also learn ways to use SwiftUI, Swift Charts, and Swift concurrency to craft innovative experiences with HealthKit.

What’s new in SwiftUI
Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.

Create custom visual effects with SwiftUI
Discover how to create stunning visual effects in SwiftUI. Learn to build unique scroll effects, rich color treatments, and custom transitions. We’ll also explore advanced graphic effects using Metal shaders and custom text rendering.