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?