Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Sources/Showcase/ImagePlayground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ struct ImagePlayground: View {
NavigationLink("Complex Layout (Portrait)") {
ImagePlaygroundComplexLayoutView(imageName: "CatPortrait")
}
NavigationLink("Butterfly LazyHGrid Stress") {
ImagePlaygroundButterflyGridStressView()
}

Text("Asset JPEG Image").font(.title).bold()
HStack {
Expand Down Expand Up @@ -388,3 +391,26 @@ private struct ImagePlaygroundComplexLayoutView: View {
}
}
}

private struct ImagePlaygroundButterflyGridStressView: View {
private let butterflies = Array(0..<600)
private let rows: [GridItem] = Array(repeating: GridItem(.fixed(24), spacing: 4), count: 10)

var body: some View {
ScrollView(.horizontal) {
LazyHGrid(rows: rows, spacing: 4) {
ForEach(butterflies, id: \.self) { _ in
Image("Butterfly", bundle: .module, label: Text("Butterfly SVG image"))
.resizable()
.scaledToFit()
.frame(width: 24, height: 24)
}
}
.padding(8)
}
.navigationTitle("Butterfly Grid Stress")
.toolbar {
PlaygroundSourceLink(file: "ImagePlayground.swift")
}
}
}
6 changes: 6 additions & 0 deletions Sources/Showcase/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,12 @@
},
"Bundled Image" : {

},
"Butterfly Grid Stress" : {

},
"Butterfly LazyHGrid Stress" : {

},
"Butterfly SVG image" : {

Expand Down
Loading