How do I make a better performing scrolling view
Asked on 2025-06-24
1 search
To create a better-performing scrolling view in SwiftUI, you can leverage several techniques and improvements introduced in recent WWDC sessions:
-
Use Lazy Stacks: SwiftUI's lazy stacks, such as
LazyVStack
, only create and render views for items that are currently visible or about to scroll into view. This can significantly reduce CPU usage and improve performance, especially for large data sets. This approach is highlighted in the session Profile and optimize power usage in your app. -
Idle Prefetching: SwiftUI and UIKit use a technique called idle prefetching, which takes advantage of idle time after rendering the current frame to prepare the next frame. This helps reduce the chance of dropping frames while scrolling. This feature is now available on macOS as well, as mentioned in the Platforms State of the Union.
-
Optimize View Updates: Avoid unnecessary view updates that can cause performance issues. Use the new SwiftUI performance instrument in Xcode to diagnose and fix long view body updates, as discussed in the session Optimize SwiftUI performance with Instruments.
-
Custom Visual Effects: You can create custom scroll effects using SwiftUI's scroll transition and visual effect modifiers. These allow you to change visual properties based on the view's position and size in a performant way. This is covered in the session Create custom visual effects with SwiftUI.
By implementing these techniques, you can enhance the performance and visual appeal of your scrolling views in 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.

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.

Build a UIKit app with the new design
Update your UIKit app to take full advantage of the new design system. We’ll dive into key changes to tab views, split views, bars, presentations, search, and controls, and show you how to use Liquid Glass in your custom UI. To get the most out of this video, we recommend first watching “Get to know the new design system” for general design guidance.