Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created October 15, 2022 03:18
Embed
What would you like to do?
final class ImageBatchLoader {
weak var delegate: ImageBatchLoaderDelegate?
init(delegate: ImageBatchLoaderDelegate) {
self.delegate = delegate
}
func start() {
DispatchQueue.global().async {
self.delegate?.imageLoader(self, didLoadBatch: [UIImage()])
}
}
}
protocol ImageBatchLoaderDelegate: AnyObject {
func imageLoader(_ imageLoader: ImageBatchLoader, didLoadBatch batch: [UIImage])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment