Image loading, processing, caching and preheating

Related tags

Image DFImageManager
Overview

Advanced framework for loading, caching, processing, displaying and preheating images.

This framework is no longer maintained.

Programming in Swift? Check out Nuke!

Features

  • Zero config
  • Works great with both Objective-C and Swift
  • Performant, asynchronous, thread safe
Loading
Caching
Processing
  • Optional FLAnimatedImage integration
  • Optional WebP integration
  • Progressive image decoding including progressive JPEG
  • Background image decompression and scaling in a single step
  • Resize and crop loaded images to fit displayed size, add rounded corners or circle
Advanced
  • Customize different parts of the framework using dependency injection
  • Create and compose image managers into a tree of responsibility

Getting Started

  • Take a look at comprehensive demo using pod try DFImageManager command
  • Check out complete documentation and Wiki
  • Install, @import DFImageManager and enjoy!

Usage

Zero Config

[[DFImageManager imageTaskForResource:<#imageURL#> completion:^(UIImage *image, NSError *error, DFImageResponse *response, DFImageTask *task){
    // Use loaded image
}] resume];

Adding Request Options

DFMutableImageRequestOptions *options = [DFMutableImageRequestOptions new]; // builder
options.priority = DFImageRequestPriorityHigh;
options.allowsClipping = YES;

DFImageRequest *request = [DFImageRequest requestWithResource:<#imageURL#> targetSize:CGSizeMake(100, 100) contentMode:DFImageContentModeAspectFill options:options.options];

[[DFImageManager imageTaskForRequest:request completion:^(UIImage *image, NSError *error, DFImageResponse *response, DFImageTask *imageTask) {
    // Image is resized and clipped to fill 100x100px square
    if (response.isFastResponse) {
        // Image was returned synchronously from the memory cache
    }
}] resume];

Using Image Task

DFImageTask *task = [DFImageManager imageTaskForResource:<#imageURL#> completion:nil];
NSProgress *progress = task.progress;
task.priority = DFImageRequestPriorityHigh; // Change priority of executing task
[task cancel];

Using UI Components

Use methods from UIImageView category for simple cases:

UIImageView *imageView = ...;
[imageView df_setImageWithResource:<#imageURL#>];

Use DFImageView for more advanced features:

DFImageView *imageView = ...;
imageView.allowsAnimations = YES; // Animates images when the response wasn't fast enough
imageView.managesRequestPriorities = YES; // Automatically changes current request priority when image view gets added/removed from the window

[imageView prepareForReuse];
[imageView setImageWithResource:<#imageURL#>];

UICollectionView

- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
    UICollectionViewCell *cell = <#cell#>
    DFImageView *imageView = (id)[cell viewWithTag:15];
    if (!imageView) {
        imageView = [[DFImageView alloc] initWithFrame:cell.bounds];
        imageView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
        imageView.tag = 15;
        [cell addSubview:imageView];
    }
    [imageView prepareForReuse];
    [imageView setImageWithResource:<#image_url#>];
    return cell;
}

Cancel image task as soon as the cell goes offscreen (optional):

- (void)collectionView:(UICollectionView *)collectionView didEndDisplayingCell:(UICollectionViewCell *)cell forItemAtIndexPath:(NSIndexPath *)indexPath {
    [((DFImageView *)[cell viewWithTag:15]) prepareForReuse];
}

Preheating Images

NSArray<DFImageRequest *> *requestsForAddedItems = <#requests#>;
[DFImageManager startPreheatingImagesForRequests:requestsForAddedItems];

NSArray<DFImageRequest *> *requestsForRemovedItems = <#requests#>;
[DFImageManager stopPreheatingImagesForRequests:requestsForRemovedItems];

Progressive Image Decoding

// Enable progressive image decoding
[DFImageManagerConfiguration setAllowsProgressiveImage:YES];

// Create image request that allows progressive image
DFMutableImageRequestOptions *options = [DFMutableImageRequestOptions new];
options.allowsProgressiveImage = YES;
DFImageRequest *request = <#request#>;

DFImageTask *task = <#task#>;
task.progressiveImageHandler = ^(UIImage *__nonnull image){
    imageView.image = image;
};
[task resume];

Customizing Image Manager

id<DFImageFetching> fetcher = <#fetcher#>;
id<DFImageDecoding> decoder = <#decoder#>;
id<DFImageProcessing> processor = <#processor#>;
id<DFImageCaching> cache = <#cache#>;

DFImageManagerConfiguration *configuration = [[DFImageManagerConfiguration alloc] initWithFetcher:fetcher];
configuration.decoder = decoder;
configuration.processor = processor;
configuration.cache = cache;

[DFImageManager setSharedManager:[[DFImageManager alloc] initWithConfiguration:configuration]];

Composing Image Managers

The DFCompositeImageManager constructs a tree of responsibility from image managers and dynamically dispatch requests between them. Each manager should conform to DFImageManaging protocol. The DFCompositeImageManager also conforms to DFImageManaging protocol so that individual managers and compositions can be treated uniformly.

id<DFImageManaging> manager1 = <#manager#>
id<DFImageManaging> manager2 = <#manager#>
id<DFImageManaging> composite = [[DFCompositeImageManager alloc] initWithImageManagers:@[manager1, manager2]];

Design

Protocol Description
DFImageManaging A high-level API for loading images
DFImageFetching Performs fetching of image data (NSData)
DFImageDecoding Converts NSData to UIImage objects
DFImageProcessing Processes decoded images
DFImageCaching Stores processed images into memory cache

Installation

CocoaPods

To install DFImageManager add a dependency in your Podfile:

pod 'DFImageManager'

By default it will install these subspecs:

  • DFImageManager/Core - DFImageManager core classes
  • DFImageManager/UI - UI components

There are four more optional subspecs:

  • DFImageManager/AFNetworking - replaces networking stack with AFNetworking
  • DFImageManager/GIF - GIF support with a FLAnimatedImage dependency
  • DFImageManager/WebP - WebP support with a libwebp dependency
  • DFImageManager/PhotosKit - Photos Framework support

To install optional subspecs include them in your Podfile:

pod 'DFImageManager'
pod 'DFImageManager/AFNetworking'
pod 'DFImageManager/GIF'
pod 'DFImageManager/WebP'
pod 'DFImageManager/PhotosKit'

Carthage

DFImageManager has a limited Carthage support that doesn't feature FLAnimatedImage and AFNetworking integration. To install DFImageManager add a dependency to your Cartfile:

github "kean/DFImageManager"

Requirements

  • iOS 8.0+ / watchOS 2
  • Xcode 7.0+

Supported Image Formats

  • Image formats supported by UIImage (JPEG, PNG, BMP, and more)
  • GIF (GIF subspec)
  • WebP (WebP subspec)

Contribution

  • If you need help, use Stack Overflow. (Tag 'dfimagemanager')
  • If you found a bug, and can provide steps to reproduce it, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, branch of the develop branch and submit a pull request.

Contacts

License

DFImageManager is available under the MIT license. See the LICENSE file for more info.

Issues
  • Callback for progress

    Callback for progress

    After upgrading i did noticed that the progressHandler from DFImageRequestOptions is missing

    whats the new alternative for a progress callback?

    question 
    opened by peterpaulis 9
  • sometimes empty image

    sometimes empty image

    hello

    i am in the process of porting to DFImageManager from SDWebImage :) - one of the main reason, the GIF support.

    right now i have a few collectionviews (inside uitabbarcontroller) each with a bunch of cells (mtl.image is DFImageView).

    doing something like

    [mtl.image prepareForReuse];
    [mtl.image setAllowsAnimations:NO];
    [mtl.image setImageWithResource:[NSURL URLWithString:obj.imageUrl]];
    

    loading the same datasource, into two tabs (collection views) - sometimes does not load images in one collectionview, and in the other it does (mainly on GIFS), i have no clue where to start debugging, any hints?

    regards helmut

    opened by hjanuschka 8
  • Caching across app launches

    Caching across app launches

    I'm using a DFImageView in a UICollectionViewCell and calling the setImageWithResource: method. The caching seems to work as long as my app is open, but every time I restart the app it downloads the images again remotely. Is there some additional configuration needed to make the cache persist across app launches?

    question 
    opened by bonebox 8
  • DFImageView and Aspect Fit

    DFImageView and Aspect Fit

    Aspect fit doesn't appear to be working properly when setting a DFImageView's image using setImageWithRequest: and the request's contentMode set to DFImageContentModeAspectFit. Mine are doing a fill instead.

    bug 
    opened by bonebox 8
  • Nullability specifier 'nonnull' conflicts with existing specifier 'nullable'

    Nullability specifier 'nonnull' conflicts with existing specifier 'nullable'

    DFImageManager/DFImageManager/Source/UI/DFImageView.m:58:12: Nullability specifier 'nonnull' conflicts with existing specifier 'nullable'

    opened by CAMOBAP 7
  • Find Alternative For __has_include

    Find Alternative For __has_include

    While looking at using this for tvOS or other platforms (might be the same for watchOS2), __has_include does not work properly with Cocoapods. I am seeing this specifically in DFImageManager+DefaultManager:

    #if __has_include("DFImageManagerKit+PhotosKit.h")
        [managers addObject:({
            DFPhotosKitImageFetcher *fetcher = [DFPhotosKitImageFetcher new];
            [[DFImageManager alloc] initWithConfiguration:[DFImageManagerConfiguration configurationWithFetcher:fetcher processor:processor cache:cache]];
        })];
    #endif
    

    One idea could do a conditional to check if it is cocoa pods, and if it is use the defines with pod specs, and if it is not then use the __has_include.

    Reference: https://github.com/CocoaPods/CocoaPods/issues/1249

    enhancement 
    opened by bassrock 7
  • Cache size

    Cache size

    How can I reduce total size of cache?

    opened by andrey-lisovskiy 6
  • watchOS

    watchOS

    This seems to work and fix #15, The same approach can also be used to add watchUI classes and OS X UI Classes.

    opened by bassrock 6
  • Custom keyboard extension crashes

    Custom keyboard extension crashes

    I have custom keyboard extension with collectionView of gifs from server. The problem is that when I'm scrolling - keyboard crashes if memory allocation more than 40 Mb.

    opened by andrey-lisovskiy 6
  • Doesn't support iOS 8 via Carthage?

    Doesn't support iOS 8 via Carthage?

    Hi, I've tried to implement DFImageManager in my project via Carthage, but as soon as I run on iOS 8 - I get crash with info: dyld: Symbol not found: _NSArray0 DFImageManager.framework/DFImageManager (which was built for iOS 9.0)

    I've dug a little in the project settings and found: IPHONEOS_DEPLOYMENT_TARGET = 9.0 in settings. Does that mean that you don't support iOS 8 anymore or is this just a mistake with Carthage setup?

    bug 
    opened by Quarezz 5
Releases(2.0.2)
  • 2.0.2(Dec 17, 2017)

    • Added ability to set the animation duration for fading in the image. Thanks to @holgersindbaek
    • Fix Xcode 9 warnings
    • Fix Xcode 9 static analyzer issues
    Source code(tar.gz)
    Source code(zip)
  • 2.0.1(Jan 12, 2016)

  • 2.0.0(Dec 27, 2015)

  • 1.0.1(Nov 18, 2015)

  • 1.0.0(Sep 27, 2015)

    Overview

    DFImageManager 1.0.0 is the first major release. It makes DFImageManager more robust and future proof.

    The main difference is the absence of conditional compilation that relied on __has_include macros. Conditional compilation now only takes place when default image manager is created and doesn't rely on __has_include. In practice from the user point of view everything should work the same way it did before.

    DFImageManager is also getting deprecated in favor of Nuke.

    Changes

    Big

    • Now requires iOS 8.0+
    • Remove conditional compilation that relied on __has_include macros
    • DFImageView can no longer be used for GIF playback, use DFAnimatedImageView instead
    • Add DFCompositeImageDecoder
    • Add DFWebPImageDecoder
    • Add DFAnimatedImageView, DFAnimatedImageDecoder, DFAnimatedImageProcessor
    • Remove +[DFImageManager sharedDecoder] dependency injector, there is now a single entry point to configure image manager and that is DFImageManagerConfiguration
    • Remove -[DFURLImageFetcher initWithSession:sessionDelegate:] method and DFURLImageFetcherSessionDelegate protocol, this feature was too hardcode for basic built-in networking
    • DFImageManager/NSURLSession subspec is removed, sources made part of DFImageManager/Core subspec
    • Add limited Carthage support

    Small

    • #12 Lightweight generics thanks to @adly-holler
    • DFImageManagerConfiguration no longer forces you to initialize it with image fetcher instance
    • Add convenience class methods to DFImageManager that forward calls to sharedManager
    • -[DFImageProcessing shouldProcessImage:forRequest:partial:] method is now optional
    • [DFImageTask resume] method now returns image task
    • Fix -[NSCache df_recommendedTotalCostLimit] for watchOS
    • Remove +[DFImageManager addSharedManager:] method
    • Remove +[DFImageManager defaultManager] method
    • DFImageManager/PhotosKit subspec is now optional
    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Sep 12, 2015)

    Overview

    DFImageManager 0.8.0 makes things more cohesive. Documentation, examples, demos, project structure - everything was revised and uncluttered. This release also features limited watchOS 2 support which at this point includes DFImageManager/Core and DFImageManager/NSURLSession subpecs.

    Changes

    Major

    • #28 DFImageFetching protocol now requires fetch operation to conform to simple DFImageFetchingOperation protocol
    • #15 watchOS 2 support, at this moment only DFImageManager/Core and DFImageManager/NSURLSession subpecs are available
    • DFImageManager/Extensions subspec with DFCompositeImageTask and DFProxyImageManager are no longer part of the framework. There are multiple more generic ways to implement those features.
    • Revised documentation, examples, demos, project structure

    Minor

    • #75 Provide an easier way to enable progressive image decoding
    • #73 -[DFImageManaging imageTaskForRequest:completion:] and -[DFImageManaging imageTaskForResource:completion:] methods return nonnull image task instead of nullable
    • Cleaner DFImageRequestOptions implementation
    • Remove canonical requests feature which was very application specific
    • Reduce number of DFImageRequestPriority options, DFImageRequestPriority no longer bound to NSOperationQueuePriority
    • Multiple implementation details are improved across the board
    Source code(tar.gz)
    Source code(zip)
  • 0.7.2(Sep 6, 2015)

  • 0.7.1(Sep 4, 2015)

    Overview

    DFImageManager 0.7.1 focuses on stability and performance. The main changes were made to the image processing. Images are now decompressed and scaled in a single step (x2-4 times faster depending on scale, significantly reduces memory usage) which allows DFImageManager to scale large images (~6000x4000 px) and prepare them for display with ease.

    Changes

    Major

    • #64 Image decompression and scaling are now made in a single step (x2-4 times faster depending on scale, significantly reduces memory usage)

    Minor

    • #70 Always draw decompressed images using kCGImageAlphaPremultipliedFirst and CGColorSpaceCreateDeviceRGB
    • #67 Refactor task queue in DFURLImageFetcher; Delay only execution of session tasks, not cancellation
    • #66 DFPhotosKitImageFetcher remove obsolete targetSize and contentMode checks in isRequestCacheEquivalent:toRequest method
    • #65 Remove excessive -[DFAnimatedImage initWithAnimatedGIFData:] method; make animatedImage property nonnull
    • #63 Remove unused methods from UIImage+DFImageUtilities
    • #60 Make DFImageManager/Core subspec smaller by moving non-core classes to DFImageManager/Extensions subspec.
    • Remove excessive DFImageViewDelegate
    • Remove excessive imageTargetSize, imageContentMode and imageRequestOptions properties from DFImageView
    • Remove excessive -[DFURLImageFetcherDelegate URLImageFetcher:didEncounterError:] method

    Bugfix

    • #71 BUGFIX: DFImageManagerImageLoader sometimes fails to cancel fetch operations
    • #69 BUGFIX: Fix -[DFImageManager invalidateAndCancel]
    • #68 BUGFIX: Add optional -[DFImageFetching invalidate] method that would allow DFURLImageFetcher and DFAFImageFetcher to invalidate NSURLSession and release delegate
    • #62 BUGFIX: Fix GIF cost calculation in DFImageCache
    • BUGFIX: Fix DFImageView priority management
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Aug 23, 2015)

    Overview

    DFImageManager 0.7.0 brings progressive image decoding support, and puts everything in its right place. It adds a separate stage for image decoding (see new DFImageDecoding protocol), and narrows role of the DFImageFetching protocol which is now only responsible for fetching image data (NSData).

    Changes

    Major

    • #46 Add a separate stage for image decoding. Add multiple ways to configure and extend image decoding: add DFImageDecoding protocol, DFImageDecoder class; add decoder to DFImageManagerConfiguration; add dependency injector to set shared decoder.
    • #41 Add GIF support for PHAsset. Also includes major changes in DFImageFetching protocol, which is now only responsible for fetching image data (NSData).
    • #28 Add progressive image decoding, including progressive JPEG support.
    • Remove ALAssetsLibrary support due to the changes to the DFImageFetching protocol that now returns NSData instead of UIImage. It's easy to add you own application-specific ALAssetsLibrary support by either implementing DFImageFetching protocol and fetching NSData (and letting DFImageManager class do all the decoding, processing, caching and preheating), or by implementing DFImageManaging protocol itself.

    Minor

    • #56 Xcode 7 compatibility
    • #54 Add shouldDecompressImages property to DFImageDecoder. Default value is YES.
    • #53 Add Carthage support
    • #52 Add defaultOptions class method to DFMutableImageRequestOptions which allows user to modify request options on per-application level
    • #51 DFImageProcessor makes a decision of weather it should process GIF images, not DFImageManager
    • #50 Add removeAllCachedImages to DFImageManaging protocol; Add optional removeAllCachedImages to DFImageFetching protocol
    • #49 Add shouldProcessImage:forRequest: method to DFImageProcessing protocol that would allow DFImageManager to skip processing step entirely
    • #47 Better signature checks to identify image formats; Add WebP signature check
    • Refactor DFImageManagerImageLoader (private class that was introduced in the previous version)
    • Improve DFImageView performance (use DFImageTask directly)
    • Remove DFNetworkReachability and auto retry from DFImageView
    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Aug 8, 2015)

    Overview

    DFImageManager 0.6.0 focuses on consistency and performance. It features some minor improvements in the API and some major improvements in the implementation. The main changes were made to the DFImageManager class that was made much more approachable.

    Changes

    Major

    • #38 DFImageRequest and DFImageRequestOptions are now immutable, options are created using builder
    • #37 Improve DFImageTaskCompletion completion block. Remove dictionary with DFImageInfo* keys; error (NSError *) is now a separate argument; add response (DFImageResponse) and completedTask (DFImageTask) parameters. It's now easier to discover all options.
    • #34 DFImageManager implementation is now much more approachable, and also more robust and performant (request execution management is moved from DFImageManager to a separate private class).
    • #32 DFImageTask now changes state synchronously on the callers thread (when you resume or cancel task). As a "side effect" DFImageManager invalidation is now thread safe.
    • #19 NSProgress is now used instead of blocks. Includes support for implicit progress composition, cancellation using progress objects, and more.

    Minor

    • #39 Improve DFCompositeImageManager dispatch logic for preheating requests
    • #36 Multiple preheating performance improvements. DFImageManager now automatically removes obsolete preheating tasks without even resuming them.
    • #35 UI classes now accept nullable resources and requests (more convenient)
    • #33 BUGFIX: Remove setNeedsUpdateConstrains call from DFImageView
    • #30 UIImageView df_setImage: family of methods now return DFImageTask
    • Make nullability annotations explicit; fixe nullability annotations in couple of places
    • Other minor improvements that include consistent dot-syntax usage, making some properties copying and more
    • Remove deprecated methods
    Source code(tar.gz)
    Source code(zip)
  • 0.5.0(Jul 19, 2015)

    Overview

    DFImageManager 0.5.0 is a major release that brings WebP support, introduces some great new APIs, and features redesigned DFCompositeImageTask.

    Changes

    • #14 WebP support
    • #22 Rename DFImageRequestID to DFImageTask, add new public interfaces (state, request, error and more)
    • #24 DFImageManager guarantees that the error is always created when the task fails
    • #25 Add -resume method to DFImageTask, tasks should not start running automatically
    • #26 Completely redesigned DFCompositeImageTask, simple interface, fully covered by unit tests
    • #27 Add - (void)getImageTasksWithCompletion:(void (^)(NSArray *tasks, NSArray *preheatingTasks))completion; method to DFImageManaging protocol
    • Minor performance improvements
    Source code(tar.gz)
    Source code(zip)
  • 0.4.1(Jul 3, 2015)

    • #21 Add documented way to determine whether the response came from memory cache. Remove undocumented way to do that from previous versions.
    Source code(tar.gz)
    Source code(zip)
  • 0.4.0(Aug 9, 2015)

    Overview

    DFImageManager now works great with Swift thanks to new nullability annotations. Some internals has also changed accordingly. Make sure that the way you use DFImageManager API complies with the new requirements.

    Changes

    Major

    • #11 Add nullability annotations
    • #13 DFImageManager's memory cache fast path is now completely transparent to the client
    • #17 Add invalidateAndCancel method to DFImageManaging protocol that cancel all outstanding requests and invalidate the image manager (new requests may not be started). DFImageManager internal tasks now hold strong references to the image manager
    • DFCompositeImageManager now raises NSInvalidArgumentException when there are no registered managers that can handle the request

    Minor

    • #9 DFImageView no longer overrides contentMode set in Interface Builder
    • #18 DFImageView no longer implements DFImageViewDelegate protocol which makes this protocol available for the clients
    • DFImageContainerView is not longer part of the framework
    • Remove ALAssetsLibrary+DFImageManager category, shared assets library is now exposed by DFAssetsLibraryImageFetcher class method
    • DFAssetsLibraryImageFetchOperation is now a private class
    • DFPhotosKitImageFetchOperation is now a private class
    • DFImageManagerConfiguration fetcher property is now readwrite, not readonly (simplifies configuration)
    • Upgrade playground
    Source code(tar.gz)
    Source code(zip)
  • 0.3.2(Jun 9, 2015)

    • Fix synchronization issue in [DFImageManager startPreheatingImagesForRequests:] method
    • Fix "multiple definition types for selector warning"
    Source code(tar.gz)
    Source code(zip)
  • 0.3.1(Mar 27, 2015)

  • 0.3.0(Mar 23, 2015)

    • New, rock solid DFImageManager implementation based on finite state machines, 25% smaller. The FSM code is based on ImageManager implementation from Nuke (experimental DFImageManager analog written in Swift).
    • Add DFImageManagerErrorDomain and DFImageManagerErrorCancelled. The DFImageManager now guarantees that completion block for the request is called when the request is cancelled.
    • DFImageRequestID implements NSCopying protocol and can be used in dictionaries, sets, etc
    • DFAFURLImageFetcher now tracks progress of data tasks
    • Fix DFImageRequestOptions priority that can now be used on iOS 7 (@andrebraga)
    • Fix crash when using DFImageProcessingCornerRadiusKey (@andrebraga)
    • Fix an issue when UIImageView (DFImageManager) wasn't canceling requests.
    • Remove -cancelRequestWithID and -setPriority:forRequestWithID: methods from DFImageManagingCore protocol. There is a single way to cancel request or change its priority (using DFImageRequestID)
    • Remove -startPreheatingImageForResources:targetSize:contentMode:options: and -stopPreheatingImageForResources:targetSize:contentMode:options: methods from DFImageManaging protocol. There is now a single way to start/stop preheating using -start(stop)PreheatingImagesForRequests: methods.
    • Streamlined DFImageManaging protocol. Remove DFImageManagingCore protocol.
    • Remove allowsSynchronousMemoryCacheLookup option, this option is always on.
    Source code(tar.gz)
    Source code(zip)
  • 0.2.1(Mar 20, 2015)

    • Fix GIF demo
    • Fix cross-dissolve issue in DFImageContainerView
    • Improve performance
    • Remove DFProcessingImageFetcher and DFProcessingInput, rely on memory cache instead of reusing processing operations (which is much easier to implement)
    • Processing operations for preheating requests now have low priority
    • Further reduce the code base
    Source code(tar.gz)
    Source code(zip)
  • 0.2.0(Mar 11, 2015)

    Overview

    This is a delightful release that brings an AFNetworking integration. Combine the power of both frameworks!

    Another great improvement is a support for CocoaPods dynamic frameworks. You can now use DFImageManager in your Swift projects.

    This version also dramatically simplifies a lot of stuff. The project structure has changed, and new subspecs have been introduced.

    AFNetworking

    This release gives you a full power of AFNetworking. All you need to do is install optional DFImageManager/AFNetworking subspec, which replaces DFImageManager networking stack with AFNetworking. The integration is dead simple, the entire subspec is just 124 lines of code. In case you don't want to use AFNetworking, the DFImageManager still provides its basic networking implementation, which is included in DFImageManager/NSURLSession subspec.

    Subspecs

    Default subspecs:

    • DFImageManager/Core - core DFImageManager classes, now just under 1600 lines of code
    • DFImageManager/UI - UI components
    • DFImageManager/NSURLSession - basic networking on top of NSURLSession
    • DFImageManager/PhotosKit - Photos Framework support
    • DFImageManager/AssetsLibrary - ALAssetsLibrary support

    Optional subspecs:

    • DFImageManager/AFNetworking - replaces networking stack with AFNetworking
    • DFImageManager/GIF - GIF support with a FLAnimatedImage dependency

    Changes

    • Add DFImageManager/AFNetworking subspec which replaces networking stack with AFNetworking when installed #5
    • Add support for CocoaPods dynamic frameworks #4
    • Move UI components to new DFImageManager/UI subspec
    • Move NSURLSession support to new DFImageManager/NSURLSession subspec
    • Move Photos Framework support to new DFImageManager/PhotosKit subspec
    • Move ALAssetLibrary support to new DFImageManager/AssetsLibrary subspec
    • DFImageManager/GIF subspec is now optional
    • +[DFImageManager setSharedManager] method is now thread safe
    • Add +[DFImageManager addSharedManager] to simplify managers composing
    • DFImageManager now holds strong references to the operations created by image fetchers
    • Remove DFURLImageRequestOptions class, use DFURLRequestCachePolicyKey instead
    • Remove DFAssetsLibraryImageRequestOptions class, use DFAssetsLibraryImageSizeKey and DFAssetsLibraryAssetVersionKey instead
    • Remove DFPhotosKitImageRequestOptions class, use DFPhotosKitVersionKey, DFPhotosKitDeliveryModeKey, DFPhotosKitResizeModeKey instead
    • Remove DFMutableImageResponse class, DFImageResponse now has a sufficient initializer and no longer need to be copied
    • Rename DFCompositeImageFetchOperation to DFImageFetchTask (emphasize that it’s not an NSOperation subclass)
    • Rename DFCompositeImageRequestContext to DFImageFetchContext
    • Remove DFImageFetchOperation, DFOperation classes
    • DFPhotosKitImageFetchOperation no longer depends on DFImageManager classes
    • Remove DFImageInfoURLResponseKey
    • Rename DFImageManagerValueTransforming to DFProxyRequestTransforming, which now has a single responsibility. The DFProxyRequestTransforming now also allows you to modify the entire request, not just a resource; Remove DFImageManagerBlockValueTransformer class
    • Make DFURLSessionOperation private
    • Improved documentation
    Source code(tar.gz)
    Source code(zip)
Owner
Alexander Grebenyuk
I write kean.blog and like porridge
Alexander Grebenyuk
A high-performance image library for downloading, caching, and processing images in Swift.

Features Asynchronous image downloader with priority queuing Advanced memory and database caching using YapDatabase (SQLite) Guarantee of only one ima

Yap Studios 71 Nov 14, 2021
Powerful image loading and caching system

Powerful Image Loading System Upgrading from the previous version? Use a Migration Guide. Nuke provides a simple and efficient way to download and dis

Alexander Grebenyuk 6.5k Jan 12, 2022
An extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memory and disk caching for iOS and ο£Ώ Watch.

KFSwiftImageLoader KFSwiftImageLoader is an extremely high-performance, lightweight, and energy-efficient pure Swift async web image loader with memor

Kiavash Faisali 343 Sep 20, 2021
🍁πŸ₯“ Lightweight and fast Swift library for image downloading, caching and transformations

MapleBacon Introduction MapleBacon is a lightweight and fast Swift library for downloading and caching images. Example The folder Example contains a s

Jan Gorman 331 Dec 20, 2021
An open source iOS framework for GPU-based image and video processing

GPUImage Brad Larson http://www.sunsetlakesoftware.com @bradlarson [email protected] Overview The GPUImage framework is a BSD-licensed iO

Brad Larson 19.9k Jan 10, 2022
GPUImage 2 is a BSD-licensed Swift framework for GPU-accelerated video and image processing.

GPUImage 2 Brad Larson http://www.sunsetlakesoftware.com @bradlarson [email protected] Overview GPUImage 2 is the second generation of th

Brad Larson 4.7k Jan 4, 2022
A GPU accelerated image and video processing framework built on Metal.

MetalPetal An image processing framework based on Metal. Design Overview Goals Core Components MTIContext MTIImage MTIFilter MTIKernel Alpha Type Hand

null 1.2k Jan 9, 2022
GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal.

GPUImage 3 Janie Clayton http://redqueengraphics.com @RedQueenCoder Brad Larson http://www.sunsetlakesoftware.com @bradlarson [email protected]

Brad Larson 2.3k Jan 4, 2022
Fabulous Image Processing in Swift

Toucan is a Swift library that provides a clean, quick API for processing images. It greatly simplifies the production of images, supporting resizing,

Gavin Bunney 2.4k Jan 4, 2022
SwiftUI Image loading and Animation framework powered by SDWebImage

SDWebImageSwiftUI What's for SDWebImageSwiftUI is a SwiftUI image loading framework, which based on SDWebImage. It brings all your favorite features f

null 1.2k Jan 12, 2022
Asynchronous image loading framework.

YYWebImage YYWebImage is an asynchronous image loading framework (a component of YYKit). It was created as an improved replacement for SDWebImage, PIN

null 3.5k Jan 5, 2022
A lightweight, pure-Swift library for downloading and caching images from the web.

Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web. It provides you a chance to use a pure-Swift way to work

Wei Wang 19.6k Jan 10, 2022
Focus on avatar caching.

Navi Navi is designed for avatar caching, with style. The name of Navi from movie Avatar. Requirements Swift 3.1, iOS 8.0 Swift 2.3, use version 0.5.0

null 115 Apr 28, 2020
An image download extension of the image view written in Swift for iOS, tvOS and macOS.

Moa, an image downloader written in Swift for iOS, tvOS and macOS Moa is an image download library written in Swift. It allows to download and show an

Evgenii Neumerzhitckii 327 Oct 29, 2021
πŸ“· A composable image editor using Core Image and Metal.

?? v2.0.0-alpha.2 now open! ?? v2.0.0 development is still early development. We have a lot of known issues. βš’ Issues are managed in v2 project ?? Pix

Muukii 2.5k Jan 12, 2022
πŸ“· A composable image editor using Core Image and Metal.

Brightroom - Composable image editor - building your own UI Classic Image Editor PhotosCrop Face detection Masking component ?? v2.0.0-alpha now open!

Muukii 2.5k Jan 14, 2022
IOS UIImage processing functions using the vDSP/Accellerate framework for speed.

UIImage Image Processing extensions using the vDSP/Accelerate framework. Fast Image Blur/Sharpen/Emboss/Matrix operations for UIImage. REQUIRES IO

null 376 Oct 12, 2021
GPU-based media processing library using Metal written in Swift

GPU-based media processing library using Metal written in Swift. Overview MetalAcc is a GPU-Based media processing library that lets you apply GPU-acc

Jiawei Wang 256 Nov 26, 2021
Photo Browser / Viewer inspired by Facebook's and Tweetbot's with ARC support, swipe-to-dismiss, image progress and more

IDMPhotoBrowser IDMPhotoBrowser is a new implementation based on MWPhotoBrowser. We've added both user experience and technical features inspired by F

Thiago Peres 2.7k Dec 21, 2021