What changes are there with ScrollView in SwiftUI

Generated on 8/2/2024

1 search

Changes to ScrollView in SwiftUI

Several enhancements have been made to ScrollView in SwiftUI, providing developers with more control and flexibility:

  1. Programmatic Control: You now have more programmatic control over your scroll views, including the ability to scroll to more positions like the top edge.
  2. Scroll Positions: There are additional scroll positions you can programmatically scroll to, enhancing navigation within the scroll view.
  3. Content Alignment: You can control the alignment of your content more precisely.
  4. Scroll Behavior: New options allow you to turn off bouncing along a given axis and programmatically stop scrolling.
  5. 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.
  6. Scroll Transitions: The scrollTransition modifier allows for custom transitions based on the scroll position, enabling effects like rotation, offset changes, and parallax effects.
  7. 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

  1. What’s new in SwiftUI
  2. Migrate your TVML app to SwiftUI
  3. Create custom visual effects with SwiftUI
Get started with HealthKit in visionOS

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

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

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.

Enhance your UI animations and transitions

Enhance your UI animations and transitions

Explore how to adopt the zoom transition in navigation and presentations to increase the sense of continuity in your app, and learn how to animate UIKit views with SwiftUI animations to make it easier to build animations that feel continuous.

What’s new in UIKit

What’s new in UIKit

Explore everything new in UIKit, including tab and document launch experiences, transitions, and text and input changes. We’ll also discuss better-than-ever interoperability between UIKit and SwiftUI animations and gestures, as well as general improvements throughout UIKit.

Migrate your TVML app to SwiftUI

Migrate your TVML app to SwiftUI

SwiftUI helps you build great apps on all Apple platforms and is the preferred toolkit for bringing your content into the living room with tvOS 18. Learn how to use SwiftUI to create familiar layouts and controls from TVMLKit, and get tips and best practices.