TopGit
GitHub Repo Review

Kingfisher: Swift Image Caching Library

onevcat/Kingfisher
KTopGit review image for onevcat/Kingfisher
Review by Topgit.dev for onevcat/Kingfisher, with GitHub repository stats and README context.
Quick verdict

Kingfisher does one job well: download, cache, and display remote images in Swift apps without pulling in Objective-C interop or a second networking library. Independent downloader/cache/processor pieces and a builder API shared between UIKit and SwiftUI make it a solid default. It earns its place once you need more than a dictionary cache โ€” the downsampling and corner-rounding processors alone save writing that code yourself.

Stars
โ˜… 24.4k
Forks
โ‘‚ 2.8k
Contributors
๐Ÿ‘ฅ 261
Language
Swift
License
MIT
Topic
Mobile
Updated
Oct 2026
Homepage
โ€”

What is Kingfisher?

Kingfisher provides a Swift-only solution for fetching and storing web images, designed for iOS, macOS, tvOS, watchOS, and visionOS platforms. The library includes a `kf` extension for UIImageView, NSImageView, and additional UIKit/AppKit components, as well as a SwiftUI `KFImage` view, all utilizing the same layered memory and disk caching system. Network requests can be cancelled, and data already retrieved is reused rather than downloaded multiple times for the same URL.

Key features of Kingfisher

  • โœ“Multi-layer hybrid cache with separate memory and disk layers, plus configurable expiration dates and size limits.
  • โœ“Opt-in async cache probing in `KingfisherManager` so disk cache checks don't block the caller thread.
  • โœ“Built-in image processors, including downsampling and round-corner processors, chainable with the `|>` operator.
  • โœ“Independent components: the downloader, cache, and processors work on their own outside the `kf`/`KFImage` extensions.
  • โœ“Cancelable downloads that reuse previously downloaded content instead of re-fetching the same URL.
  • โœ“Extensions across UIImageView, NSImageView, NSButton, UIButton, WKInterfaceImage, TVMonogramView, and CPListItem.
  • โœ“SwiftUI support via `KFImage`, plus Swift 6 and strict-concurrency readiness.
  • โœ“Live Photo loading and caching, and Low Data Mode support for constrained networks.
How this repository's GitHub stars have grown over time. Source: star-history.com.View the star history โ†—

Installing Kingfisher in your project

Kingfisher installs through Swift Package Manager: in Xcode, choose File > Swift Packages > Add Package Dependency, add `https://github.com/onevcat/Kingfisher.git`, and select the "Up to Next Major" rule with "8.0.0". CocoaPods works too: ```ruby source 'https://github.com/CocoaPods/Specs.git' platform :ios, '13.0' use_frameworks! target 'MyApp' do pod 'Kingfisher', '~> 8.0' end ``` There's also a pre-built option: download `Kingfisher.xcframework` from the GitHub release page's assets, drag it into your project, add it to your app target, and in the target's "Frameworks, Libraries, and Embedded Content" section set it to "Embed Without Signing". Kingfisher 8.0 needs iOS 13.0+/macOS 10.15+/tvOS 13.0+/watchOS 6.0+/visionOS 1.0+ for the UIKit/AppKit extension, iOS 14.0+/macOS 11.0+/tvOS 14.0+/watchOS 7.0+/visionOS 1.0+ for the SwiftUI `KFImage` view, and Swift 5.9+.

Loading images with Kingfisher: UIKit and SwiftUI examples

The simplest call is the UIKit extension: ```swift import Kingfisher let url = URL(string: "https://example.com/image.png") imageView.kf.setImage(with: url) ``` Kingfisher downloads the image, writes it to both the memory and disk cache, and shows it in `imageView`; setting the same URL again pulls from cache instead of re-downloading. The SwiftUI equivalent is `KFImage`: ```swift var body: some View { KFImage(URL(string: "https://example.com/image.png")!) } ``` For real screens you'll usually chain processors. This downsamples a high-resolution image to the view's bounds, rounds its corners, and shows an activity indicator and placeholder while it loads: ```swift let url = URL(string: "https://example.com/high_resolution_image.png") let processor = DownsamplingImageProcessor(size: imageView.bounds.size) |> RoundCornerImageProcessor(cornerRadius: 20) imageView.kf.indicatorType = .activity imageView.kf.setImage( with: url, placeholder: UIImage(named: "placeholderImage"), options: [ .processor(processor), .scaleFactor(UIScreen.main.scale), .transition(.fade(1)), .cacheOriginalImage ]) { result in switch result { case .success(let value): print("Task done for: \(value.source.url?.absoluteString ?? "")") case .failure(let error): print("Job failed: \(error.localizedDescription)") } } ``` If you'd rather not use the `kf` extension, the `KF` builder chains the same options as method calls and ends with `.set(to: imageView)`. Swap `KF` for `KFImage` and the identical chain works in SwiftUI instead.

Why developers choose Kingfisher

  • โœ“Ships as a single pure-Swift dependency, with no Objective-C bridging headers to maintain.
  • โœ“Downloader, cache, and processors are independent components usable outside the `kf`/`KFImage` extensions.
  • โœ“The `KF`/`KFImage` builder API mirrors between UIKit and SwiftUI, so switching a screen keeps the same processor pipeline.
  • โœ“Cache behavior โ€” expiration date, size limit โ€” is directly configurable rather than fixed.
  • โœ“Downsampling and corner-rounding processors ship out of the box instead of requiring a separate imaging library.

Limitations of Kingfisher

  • โ–ณInstalling via the pre-built xcframework means manually dragging the framework into your project and setting "Embed Without Signing" โ€” more steps than a one-line SPM add.
  • โ–ณCache size and expiration tuning is manual, not automatic.
  • โ–ณSwiftUI's `KFImage` needs a newer OS floor (iOS 14.0+) than the UIKit `kf` extension (iOS 13.0+ on 8.0), so mixed UIKit/SwiftUI targets have to track two requirement sets.
  • โ–ณNew feature requests are asked to go through a GitHub discussion first before a pull request, which can slow contributions down.
View on GitHub โ†—

Kingfisher alternatives

SDWebImage โ€” the older Objective-C-rooted image loading and caching library that Kingfisher's own FAQ gets compared against most; a reasonable pick if a project already depends on it.Nuke โ€” a Swift-native image loading library built around URLSession and Swift concurrency, worth a look for a smaller API surface than Kingfisher's processor pipeline.AlamofireImage โ€” an image-loading extension for Alamofire, a fit mainly if a project already pulls in Alamofire for its networking layer.

Frequently asked questions about Kingfisher

Is Kingfisher free for commercial iOS app development?

Kingfisher is released under the MIT license, which permits commercial use, modification, and redistribution without royalty payments, as stated in the project's LICENSE file.

Does Kingfisher support SwiftUI and UIKit?

Kingfisher supports both: the `kf` extension covers UIKit and AppKit views such as UIImageView and NSImageView, while the `KFImage` view provides the same image loading and caching for SwiftUI.

How do I install Kingfisher using Swift Package Manager?

Kingfisher installs via Xcode's File > Swift Packages > Add Package Dependency, adding `https://github.com/onevcat/Kingfisher.git` and choosing the "Up to Next Major" rule with version "8.0.0".

What iOS and macOS versions does Kingfisher support?

Kingfisher 8.0 requires iOS 13.0+ and macOS 10.15+ for its UIKit/AppKit extension, and iOS 14.0+ and macOS 11.0+ for the SwiftUI `KFImage` view, per the project's stated requirements.

Can Kingfisher handle image downsampling and corner rounding?

Kingfisher can chain a `DownsamplingImageProcessor` with a `RoundCornerImageProcessor` using the `|>` operator, downsampling a source image to the view's bounds and rounding its corners in a single processing step.

How does Kingfisher compare to SDWebImage for Swift projects?

Kingfisher is written in pure Swift with a native SwiftUI view, `KFImage`, built in, while SDWebImage has Objective-C roots. Beyond that language difference, the README doesn't lay out a feature-by-feature comparison.

The problem it solves

iOS and macOS developers loading remote images by hand tend to rewrite the same URLSession download, memory/disk cache, and cancellation logic in every project, then bolt on corner-rounding or downsampling manually with Core Graphics. Kingfisher packages that combination โ€” async download, a hybrid cache with configurable expiration and size limits, and a chainable processor pipeline โ€” into one dependency instead of leaving each app to rebuild it from a raw URLSession call.

Best use cases

  • โ€ขPopulating a table or collection view with remote thumbnails without hand-writing download and cache logic.
  • โ€ขLoading a high-resolution detail image, downsampled and corner-rounded to fit the view, while the original stays cached separately.
  • โ€ขPrefetching a list of image URLs ahead of scrolling so cells render already cached.
  • โ€ขAdding a remote image view to a SwiftUI screen via `KFImage` instead of a custom `AsyncImage` wrapper.
  • โ€ขLoading and caching Live Photo assets alongside regular still images.

Who should try it โ€” and who should skip

Try Kingfisher if you're building for iOS, macOS, tvOS, watchOS, or visionOS in Swift and need remote image loading backed by a real cache โ€” memory and disk layers with expiration and size limits, plus downsampling and corner-rounding processors ready to chain. It also fits teams shipping the same screen in both UIKit and SwiftUI, since the builder API carries over. Skip it if your app is Objective-C-first with no Swift bridge planned, if you're already locked into SDWebImage's cache format, or if you only ever load a single placeholder icon and a full caching layer is overkill.

Related repositories

Source & attribution

Facts sourced from the onevcat/Kingfisher GitHub repository (github.com/onevcat/Kingfisher), including its README and repository metadata.

GitHub data ยท last synced Aug 15, 2026Reviewed by Henry
โ† Back to TopGit

Curious whether Kingfisher is right for you?

Let ChatGPT, Claude, or Perplexity look into it โ€” click below and see what AI actually says about Kingfisher.

GitHub