Skip to content

Instantly share code, notes, and snippets.

@xspyhack
Last active June 18, 2021 18:04
Show Gist options
  • Save xspyhack/4feaca5101d4d97294ec7eb2438511e7 to your computer and use it in GitHub Desktop.
Save xspyhack/4feaca5101d4d97294ec7eb2438511e7 to your computer and use it in GitHub Desktop.
FB7812486: LazyVGrid poor performance
import SwiftUI
// https://developer.apple.com/documentation/swiftui/lazyvgrid
struct ContentView: View {
var columns: [GridItem] =
Array(repeating: .init(.flexible()), count: 4)
var body: some View {
ScrollView {
LazyVGrid(columns: columns) {
ForEach((0...7900), id: \.self) {
let codepoint = $0 + 0x1f600
let codepointString = String(format: "%02X", codepoint)
Button(action: {
}) {
Text(codepointString)
}
}
}.font(.largeTitle)
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
@ulitiy
Copy link

ulitiy commented Apr 9, 2021

have you found a solution for choppy LazyVGrid?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment