Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageTaskDelegate #559

Merged
merged 9 commits into from
Jun 14, 2022
Merged

ImageTaskDelegate #559

merged 9 commits into from
Jun 14, 2022

Conversation

kean
Copy link
Owner

@kean kean commented Jun 14, 2022

Add ImageTaskDelegate to achieve complete feature-parity with completion-based APIs:

Loading an image and monitoring download progress:

func loadImage() async throws {
    let response = try await pipeline.image(for: "https://example.com/image.jpeg", delegate: self)
}

func imageTask(_ task: ImageTask, didUpdateProgress progress: (completed: Int64, total: Int64)) {
    print("Image task did update progress: \(progress)")
}

All ImageTaskDelegate methods are guaranteed to be called on the pipeline's callbackQueue (main queue, by default).

@kean kean changed the base branch from master to nuke-11 June 14, 2022 02:59
@kean kean changed the title Draft: ImageTaskDelegate ImageTaskDelegate Jun 14, 2022
@kean kean mentioned this pull request Jun 14, 2022
@kean kean merged commit 308c5e4 into nuke-11 Jun 14, 2022
@kean kean deleted the image-task-delegate branch June 14, 2022 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant