[tvOS 18][SwiftUI] Severe ScrollView Lag after Update

Hello,

I've upgraded both of my Apple TVs to tvOS 18. Since then, my app developed with SwiftUI has become almost unusable due to severe lag, particularly when scrolling in a LazyVStack. On the A1625 (Apple TV HD), the lag can last up to 20 seconds, while on the A2843 (Apple TV 4K, 3rd generation, Wi-Fi + Ethernet), it’s about one second.

I can consistently reproduce the issue with this minimal example:

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
          ScrollView {
            LazyVStack {
              ForEach(0..<1000) { nb in
                Button("Item \(nb)") {}
              }
            }
          }
        }
    }
}

Using Instruments, I found that the hang is related to this call:

389.00 ms 71,4 % 6.00 ms +[_UIFocusRegionEvaluator __regionsByEvaluatingOcclusionsForBaseRegions:occludingRegions:baseRegionsCanOccludeEachOther:inSnapshot:]

Unfortunately, I can't attach the Instruments trace directly here, but you can download it from this link: https://drive.google.com/file/d/1sEIwXhr7_ajjRHZevCIW6jNOlPjaeU6L/view?usp=sharing

Important notes:

The same screen, when written in UIKit, runs smoothly on both devices. After performing a factory reset on the older device, the performance issue disappeared. However, as you can imagine, I’m already receiving complaints from users who are understandably unwilling to reset their devices.

Does anyone know of a workaround until this is addressed by Apple?

I am having the exact same issue with my app. small arrays are fine, but the bigger the array the slower it becomes.

Did you discover any work around to this issue ?

I replaced LazyVStack by a List. If you are using a LazyVGrid, it's more difficult because you have to create a fake grid using a List...

Thanks, I will give it a try - I am also trying to look into UIScrollview, which is way more performant. But I have 0 experience with UIKIT :(

edit : well, unfortunately for me it is not possible. Using a list means it will fetch in remote data of all the elements in that list.

[tvOS 18][SwiftUI] Severe ScrollView Lag after Update
 
 
Q