Severe Frame Drops When Resizing macOS Window with Dynamic LazyVGrid

Context: I am building a macOS file (currently image only) browser using SwiftUI. The core view is a ScrollView containing a LazyVGrid. The layout is dynamic: as the window resizes, I calculate the optimal number of columns and spacing using a GeometryReader.

The Issue: While scrolling is pretty smooth (thanks to custom image caching and prefetching), window resizing is significantly laggy. After having scrolled the UI stutters and drops frames heavily while dragging the window edge.

The Code: https://github.com/MorusPatre/Binder

Hi @Moretheus,

Thank you for providing this sample project, I'm taking a look now and I don't see any lag when resizing on my end, do you mind providing more information to help me reproduce the issue?

Is there any console errors with this UI stutter? And what version of MacOS and Xcode are we working with? It works fine for me on 26.2 for both Xcode and macOS Tahoe

You can provide more information such as video or gif examples in this thread.

It does look great so far!! Nice work 🤓

 Travis Trotto - DTS Engineer

Severe Frame Drops When Resizing macOS Window with Dynamic LazyVGrid
 
 
Q