Redesign the concurrency APIs in Nuke ahead of the upcoming changes in Xcode 14.3, making them safer and ergonomic to use, and fully Sendable
-compliant.
- Add
ImagePipeline/imageTask(with:)
method that returns a new typeAsyncImageTask
that you can use to monitor the task progress, change its priority, and, of course, fetch the response.
let task = ImagePipeline.shared.imageTask(with: URL(string: "example.com"))
for await progress in task.progress {
print("Updated progress: ", progress)
}
let image = try await task.image
- The existing convenience
ImagePipeline/image(for:)
methods now return an image (UIImage
orNSImage
) instead ofImageResponse
- Remove the
delegate
parameter from the existingImagePipeline/image(for:)
async/await method to address the upcoming concurrency warnings in Xcode 14.3 - Remove
ImageTaskDelegate
and move its methods toImagePipelineDelegate
and add thepipeline
parameter - Add one final
LazyImage
optimization where when the image is in memory cache,LazyImage
now requires a single body calculation to render it (instead of three before) – can't get better than this - Use an improved way to generate xcframeworks, significantly reducing their size