what's new with scrollviews in Swiftui ?
Asked on 2024-07-29
1 search
What's New with ScrollViews in SwiftUI
At WWDC 2024, Apple introduced several new features and enhancements for ScrollViews in SwiftUI. Here are the key updates:
-
Programmatic Control: You now have more programmatic control over your ScrollViews, including the ability to scroll to specific positions like the top edge. This allows for more precise control over the scrolling behavior in your apps.
-
Scroll Positions: There are additional scroll positions available, giving you more flexibility in how you manage and interact with scrollable content.
-
Scroll Modifiers: New modifiers have been introduced to enhance the scrolling experience. For example, the
onScrollVisibilityChangemodifier allows you to detect when a view's visibility changes due to scrolling. This can be used to create dynamic experiences, such as auto-playing videos when they come into view. -
Scroll Geometry Change: The
onScrollGeometryChangemodifier lets you react to changes in content offsets, content size, and other scroll-related properties. This can be used to create responsive UI elements that adjust based on the scroll position. -
Content Alignment and Bouncing: You can now control content alignment and disable bouncing along a given axis, providing a more tailored scrolling experience.
-
Custom Scroll Effects: The
scrollTransitionmodifier allows you to create custom scroll effects. For example, you can rotate and offset elements based on their position in the scroll view, enabling unique visual effects like a circular carousel.
For more detailed information, you can refer to the following sessions:
- What’s new in SwiftUI (16:47)
- Create custom visual effects with SwiftUI (02:07)
These sessions provide in-depth explanations and examples of the new ScrollView features and how to implement them in your SwiftUI applications.

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.

SwiftUI essentials
Join us on a tour of SwiftUI, Apple’s declarative user interface framework. Learn essential concepts for building apps in SwiftUI, like views, state variables, and layout. Discover the breadth of APIs for building fully featured experiences and crafting unique custom components. Whether you’re brand new to SwiftUI or an experienced developer, you’ll learn how to take advantage of what SwiftUI has to offer when building great apps.

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.
