how to get scroll offset for a List in SwiftUI
Generated on 9/6/2024
1 search
To get the scroll offset for a List
in SwiftUI, you can use the new onScrollGeometryChange
modifier introduced in the latest updates. This modifier allows you to react to changes in the scroll view's content, such as offsets and content size. This feature is part of the enhancements to scrolling in SwiftUI, as discussed in the session What’s new in SwiftUI (16:18).
For more detailed examples and advanced techniques, you might want to explore the session Create custom visual effects with SwiftUI (01:29), which covers custom scroll effects and transitions.
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.
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.
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.
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.