-
-
Save laevandus/e3e696d0bc0a6e31e32767348f50f8cd to your computer and use it in GitHub Desktop.
This file contains 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
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