-
-
Save laevandus/0fbb698aed67a884f0e212b07bc28b31 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
@MainActor final class ViewModel: ObservableObject { | |
private let imageLoader: ImageBatchLoader | |
private let imageLoaderHandler: ImageBatchLoaderHandler | |
init() { | |
imageLoaderHandler = ImageBatchLoaderHandler() | |
imageLoader = ImageBatchLoader(delegate: imageLoaderHandler) | |
imageLoaderHandler.didLoadBatch = handleBatch | |
imageLoader.start() | |
} | |
func handleBatch(_ batch: [UIImage]) { | |
print("isMainThread", Thread.isMainThread, #function) | |
// redacted | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment