Nuke 2.0
Nuke now has an official website!
Main Changes
- #48 Update according to Swift API Design Guidelines. All APIs now just feel right.
- Add
ImageRequestMemoryCachePolicyenum that specifies the wayImageManagerinteracts with a memory cache;NSURLRequestCachePolicyno longer affects memory cache - Add
UIImageextension with helper functions forCore Image:nk_filter(_:), etc. - Add
ImageFilterGaussianBluras an example of a filter on top ofCore Imageframework - #17 Add
prioritytoImageRequest - Add
removeResponseForKey()method toImageMemoryCachingprotocol and the corresponding method toImageManager - Implement congestion control for
ImageLoaderthat preventsNSURLSessiontrashing - Simplify
ImageLoaderDelegateby combining methods that were customizing processing in a single high-level method:imageLoader(_:processorFor:image:). Users now have more control over processing - Add
NSURLResponse?parameter todecodemethod fromImageDecodingprotocol ImageDataLoadingprotocol no longer hasisLoadEquivalentRequest(_:toRequest)andisCacheEquivalentRequest(_:toRequest). Those methods are now part ofImageLoaderDelegateand they have default implementationImageResponseInfois now a struct- Improved error reporting (codes are now stored in enum, more codes were added, error is now created with a failure reason)
UI Extensions Changes
- Move
nk_imageTask(_:didFinishWithResponse:options)method toImageLoadingViewprotocol, that's really where it belongs to - Add
handlerproperty toImageViewLoadingOptionsthat allows you to completely override display/animate logic inImageLoadingView - Remove
nk_prepareForReusemethod fromImageLoadingViewextensions (useless) - Remove
placeholderfromImageViewLoadingOptions, move it to a separate argument which is only available onImageDisplayingViews - Add
animated,userInfotoImageViewLoadingOptions ImageViewLoadingOptionsis now nonull everywhere- Add
setImageWith(task:options:)method toImageViewLoadingController
Other Changes
- If you add a completion handler for completed task, the response is now marked as
isFastResponse = true - Fix an issue that allowed incomplete image downloads to finish successfully when using built-in networking
equivalentProcessors(rhs:lhs:)function is now private (and it also is renamed)- Remove public
isLoadEquivalentToRequest(_:)andisCacheEquivalentToRequest(_:)methods fromImageRequestextension - Add
ImageTaskProgressstruct that represents load progress, movefractionCompletedproperty fromImageTasktoImageTaskProgress - Remove public helper function
allowsCachingfromImageRequestextension - Remove deprecated
XCPSetExecutionShouldContinueIndefinitelyfrom playground