What’s new in SwiftUI scrollview

Generated on 8/2/2024

1 search

In the session What’s new in SwiftUI, several enhancements to ScrollView were introduced:

  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.
  3. Scroll Behavior Customization: You can turn off bouncing along a given axis, programmatically stop scrolling, and control content alignment.
  4. On Scroll Geometry Change: A new onScrollGeometryChange modifier lets you react to changes in content offsets, content size, and more.
  5. On Scroll Visibility Change: You can detect when a view's visibility changes due to scrolling, allowing for experiences centered around content moving on or off screen.

Additionally, in the session Migrate your TVML app to SwiftUI, new view modifiers specific to ScrollView in tvOS 18 were discussed, such as the onScrollVisibilityChange modifier to handle visibility changes of views when they scroll off screen.

For more advanced customizations, the session Create custom visual effects with SwiftUI demonstrated how to use the scrollTransition modifier to create unique scroll effects, such as rotating and offsetting elements to create a circular carousel or parallax effect.

These enhancements provide developers with more tools to create rich and interactive scrolling experiences in their SwiftUI applications.

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.

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.

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.

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.

Platforms State of the Union

Platforms State of the Union

Discover the newest advancements on Apple platforms.

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.