Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created October 15, 2022 03:18
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/7b72930bb6c026a014ef48493ea76edb to your computer and use it in GitHub Desktop.
Save laevandus/7b72930bb6c026a014ef48493ea76edb to your computer and use it in GitHub Desktop.
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