Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created July 18, 2021 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/e3e696d0bc0a6e31e32767348f50f8cd to your computer and use it in GitHub Desktop.
Save laevandus/e3e696d0bc0a6e31e32767348f50f8cd to your computer and use it in GitHub Desktop.
struct ContentView: View {
let imageNamesToLoad = ["Screenshot1", "Screenshot2", "Screenshot3", "Screenshot4", "Screenshot5", "Screenshot6", "Screenshot7", "Screenshot8", "Screenshot9", "Screenshot10"]
@State private var images = [UIImage]()
var body: some View {
ScrollView {
LazyVStack {
ForEach(images, id: \.self) { image in
Image(uiImage: image)
}
}
}
.task {
for await image in ThumbnailSequence(imageNames: imageNamesToLoad, maxSize: CGSize(width: 256, height: 256)) {
print("Loaded \(image)")
self.images.append(image)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment