Last active
June 18, 2021 18:04
-
-
Save xspyhack/4feaca5101d4d97294ec7eb2438511e7 to your computer and use it in GitHub Desktop.
FB7812486: LazyVGrid poor performance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
have you found a solution for choppy LazyVGrid?