kean/DFImageManager

DFImageManager vs Nuke

Closed this issue · 1 comments

It's so sad to see that DFImageManager is deprecated :( I'm already using DFImageManager in my Objective-C project, and I'd appreciate your recommendation, should I migrate to Nuke?

kean commented

WARNING: OUTDATED!

TL;DR: Nuke is Swift only, you can't use it from Objective-C. Stick with DFImageManager for Objective-C, I'm not going to stop maintaining it any time soon. Use Nuke for new projects.

Nuke is not a simple translation from Objective-C to Swift, it's created from the ground up. The main goal in Nuke was simplicity without compromising on extensibility. And I'm very happy with the way it turned out.

The main difference between frameworks is that DFImageManager abstracts away from NSURLRequest and NSURLSession, and Nuke doesn't.

And here's a (not complete) comparison:

What Nuke has that DFImageManager doesn't:

  • Multi-platform (iOS, OSX, watchOS, tvOS)
  • Alamofire integration
  • Makes it extremely easy to add full-featured image loading extensions for UI components
extension MKAnnotationView: ImageDisplayingView, ImageLoadingView {
    // That's it, you get default implementation of all methods in ImageLoadingView protocol
    public var nk_image: UIImage? {
        get { return self.image }
        set { self.image = newValue }
    }
}
  • User-friendly API to create, compose and apply image filters
  • User-friendly API to create and compose image decoders
  • A lot of improvements in interfaces throughout the project (closure for progress instead of NSProgress, type-safe ImageResponse enum, ImageTask acts like a promise, etc)
  • Much smaller in terms of lines of code (partially thanks to Swift), implementation is much easier to understand

What DFImageManager has that Nuke doesn't:

  • AFNetworking integration
  • Allows you to compose image managers (DFCompositeImageManager)
  • PhotosKit support (including animated GIFs support)
  • WebP support
  • Progressive image decoding
  • Request priorities (will be available in Nuke soon)