Skip to content

Kingfisher

A Swift library that downloads, caches, and displays images from the web in apps.

Stars
24.4k
Forks
2.8k
Licence
MIT
Language
Swift
Last update
4 days ago
Type
Library

What it is

Kingfisher is a Swift library for loading images from URLs into iOS, macOS, tvOS, watchOS and visionOS apps. It downloads an image, keeps it in memory and on disk, and reuses the cached copy the next time the same URL is requested. It also offers image processors such as downsampling and rounded corners, and works with both UIKit/AppKit views and SwiftUI.

  • Show a remote profile photo in a UIImageView with a placeholder and a fade-in transition
  • Downsample a large image to the size of its view and round its corners before display
  • Prefetch a set of images so they are already in the cache when a screen appears
  • Display a remote image in SwiftUI using the KFImage view

Great for

  • iOS or macOS developers who need to show remote images in lists or detail screens
  • Teams building SwiftUI apps that display images from URLs
  • Developers who want caching and resizing handled by a library instead of written by hand
  • Projects that only need to use parts of the library, such as the downloader or the cache, separately

Not ideal for

  • Non-Swift projects, since the library is written in pure Swift for Apple platforms (reason: it does not run on Android or the web)
  • Apps with unusual caching rules that go beyond the expiration and size controls described in the README (reason: those controls may not cover every case)
  • Developers on Swift versions older than the ones listed for their chosen Kingfisher release (reason: requirements differ by major version)
Step-by-step guide: how to use KingfisherInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Xcode 26.0+ and Swift 6.2+ for the current development branch (per README) · Swift 5.9+ for Kingfisher 8.0 (per README)

    Add via Swift Package Manager in Xcode

    File > Swift Packages > Add Package Dependency

    Repository URL to add

    https://github.com/onevcat/Kingfisher.git
  2. 2

    Run it

    • Add the package in Xcode using the repository URL and select 'Up to Next Major' with 8.0.0
    • Import Kingfisher in a Swift file
    • Call imageView.kf.setImage(with: url) with a valid URL
    • Run the app and confirm the image loads; set the same URL again to see the cached result
  3. 3

    Get the most out of it

    • Use the options parameter to add a processor, a fade transition, and .cacheOriginalImage
    • Use DownsamplingImageProcessor to reduce memory use for large images displayed in small views
    • Use the KF builder syntax for a chained, readable configuration
    • Use KFImage with the same chained methods when moving from UIKit to SwiftUI
    • Use .lowDataModeSource to supply a low-resolution fallback for Low Data Mode

Downloads

Strengths

  • Caches images in both memory and disk, so repeated loads of the same URL are fast
  • Supports UIKit, AppKit, and SwiftUI, with examples for each in the README
  • Components such as the downloader, cache, and processors can be used independently

Trade-offs

  • Only works on Apple platforms and requires Xcode and Swift
  • Minimum OS versions and Swift versions depend on the release, so older projects may need to pin an older major version
  • The README is truncated, so details on advanced configuration are only available in the linked external documentation

How it compares

ProjectStarsTypeLevelUpdatedBest for
Kingfisher (this)24.4kLibrarybeginner4 days agoiOS or macOS developers who need to show remote images in lists or detail screens
SDWebImage25.6kLibraryintermediate7 months agoiOS or macOS app developers who need to show remote images in lists or grids
SwifterSwift15.3kLibrarybeginner4 days agoSwift developers building iOS or macOS apps who want common helper methods ready to use
xtool14.5kDev toolintermediate6 days agoDevelopers who want to build iOS apps but do not use a Mac as their main machine
ipatool12.1kCLIintermediate12 days agoDevelopers who want to script App Store searches or downloads from the terminal
AudioKit11.5kLibraryintermediate3 months agoSwift developers adding synthesizers, effects, or audio analysis to an iOS or macOS app

Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.