Repository navigation
Nuke 11.0 (RC1)
Pre-releaseNuke 11 embraces Swift Structured Concurrency with full feature parity with legacy completion-based APIs. NukeUI is now part of the main repo. Docs were completely rewritten using DocC and hosted on GitHub: Nuke, NukeUI, NukeExtensions.
There are no major source-breaking changes in this release. Instead, it adds dozens of API refinements to make the framework more ergonomic.
- Increase the minimum supported Xcode version to 13.3
- Increase minimum supported platforms: iOS 13.0, tvOS 13.0, watchOS 6.0, macOS 10.15
Structured Concurrency
Extend Async/Await APIs to have complete feature parity with the existing completion-based APIs paving the road for its eventual deprecation and removal in the future major versions.
- Add
@MainActorto the following types:FetchImage,LazyImage,LazyImageView, NukeloadImage(into:)method - Add
Sendableto most of the Nuke types, includingImagePipeline,ImageRequest,ImageResponse,ImageContainer,ImageTask, and more - Add
ImageTaskDelegateto achieve complete feature-parity with completion-based APIs - #559 ImageRequestnow accepts async/await function to fetch data as a resource
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 imageTaskCreated(_ task: ImageTask) {
// You can capture the task instance here to change priority later, etc
}
func imageTask(_ task: ImageTask, didUpdateProgress progress: ImageTask.Progress) {
// Update progres
}
func imageTask(_ task: ImageTask, didReceivePreview response: ImageResponse) {
// Display progressively decoded image
}
// And more...NukeUI and NukeExtensions
NukeUI is now part of the main repo and the existing UIKit and AppKit UI extensions were moved from the main module to NukeExtensions and soft-deprecated.
- Move NukeUI to the main Nuke repo
- Move
UIImageView/NSImageViewextensions to a separate targetNukeExtensionsand soft-deprecated them - #555 - Remove deprecated APIs from NukeUI
- Add
ImageResponsetypealias to NukeUI - Use new
ImageTask.Progressin NukeUI - NukeUI no longer exposes public Gifu dependency or its APIs
Error Reporting Improvements
A complete overhaul of ImagePipeline.Error with many new cases covering every single point of failure in the pipeline.
- Add
throwsto "advanced"ImageProcessing - Add
throwstoImageDecoding - Add support for throwing processing in
ImageProcessors.CoreImageFilter - Add
ImageDecodinginstance,ImageDecodingContext, and underlying error to.decodingFailederror case - Add
ImageProcessingContextand underlying error to.processingFailederror case - Add
.dataMissingInCacheerror case for a scenario where data is missing in cache and download is disabled using.returnCacheDataDontLoad. - Add
.dataIsEmptyerror case for a scenario where the data loader doesn't report an error, but the response is empty. - Add
.decoderNotRegistered(context:)error case for a scenario where no decoders are registered for the downloaded data. This should never happen unless you remove the default decoder from the registry. - Add
.imageRequestMissingerror case for a scenario when the load image method is called with no image request. - Add
cacheTypetoImageDecodingContext
Other Changes
- Fix #511
OSAtomicdeprecation warnings - #573 - Add
ImageTask.State. Improve performance when canceling and changing priority of completed tasks. - Add
ImageTask.Progressto simplify progress reporting APIs - Add
ImageRequest.Options.skipDecompression - Add public
ImageCacheKeyinitializer withImageRequest - Add
imageCache(for:pipeline:)method toImagePipelineDelegate - Add automatic
hashableIdentifierimplementation toImageProcessingtypes that implementHashableprotocol - #563 - Add a way to customize decompression using
ImagePipelineDelegate - Add
ImageRequesttoImageResponse - Improve decompression performance by using
preparingForDisplayon iOS 15 and tvOS 15 - Add metrics reporting using
DataLoaderObservingprotocol - Add custom disk caching for requests backed by data publishers - #553
- Add
.pipelineInvalidatederror that is thrown for new requests started on the invalidated pipeline - Add public write access to
ImageDecodingContext,ImageProcessingContext,ImageResponseproperties - Add static
defaultandimageIOfunctions toImageEncodingprotocol for easy creating of encoders - Add
sizeLimittowithDataCacheImagePipeline.Configurationinitializer - Make
ImageCachettloptional instead of using0as a "never expires" indicator
Removals and Deprecations
- Soft-deprecate
ImageRequestConvertibleand useImageRequestandURLdirectly in all news APIs for better discoverability and performance - #567 - Deprecate
ImageDecoderRegistering - Deprecate
ImageCachingextension that works withImageRequest - Rename
isFinalinImageProcessingContexttoisCompletedto match the renaming APIs - Rename
ImagePipeline/Configuration/DataCachePolicytoImagePipeline/DataCachePolicy - Remove
ImageRequestConvertibleconformance fromString - Remove
ImageTaskEventand consolidate it with the newImageTaskDelegateAPI - #564 - Remove progress monitoring using
Foundation.Progress - Remove
WKInterfaceObjectsupport (in favor of SwiftUI) - Remove
ImageTypetypealias (deprecated in 10.5) - Remove
Cancellableconformance fromURLSessionTask - Remove public
ImagePublisherclass (make it internal)
Non-Code Changes
- Automatically discover typos on CI - #549
- Remove
CocoaPodssupport