Kingfisher is a powerful, pure-Swift library for downloading and caching images from the web. It provides an elegant, asynchronous API for managing remote images in iOS, macOS, tvOS, watchOS, and visionOS applications. The library handles the complete lifecycle of image loading - from network downloading to multi-layer caching (memory and disk), with built-in image processing capabilities and extensive platform-specific UI component integrations.
The framework follows a modular architecture with clear separation of concerns, allowing developers to use individual components (downloader, cache, processors) independently or as a unified solution. Through its namespace wrapper pattern (.kf property) and builder pattern (KF.url()), Kingfisher offers both UIKit and SwiftUI support with minimal code overhead.
Sources/Networking/ImageDownloader.swift - URLSession-based networking layerSources/Cache/ImageCache.swift - Dual-layer cache coordinatorSources/Cache/MemoryStorage.swift - In-memory cache implementationSources/Cache/DiskStorage.swift - Persistent disk storageSources/Image/ImageProcessor.swift - Transformation pipeline with filtersSources/Image/ImageFormat.swift - Multi-format detection (JPEG, PNG, GIF, WebP)Sources/Extensions/UIButton+Kingfisher.swift, Sources/Extensions/NSTextAttachment+Kingfisher.swiftSources/SwiftUI/KFImageProtocol.swift, Sources/SwiftUI/ImageBinder.swiftSources/Views/AnimatedImageView.swift, Sources/Extensions/PHLivePhotoView+Kingfisher.swiftfastlane/Fastfile - Primary build automationTests/KingfisherTests/ - XCTest-based unit tests with Nocilla HTTP stubbingSources/Documentation.docc/ - DocC integrated documentation#if os(iOS))#if os(macOS))#if os(tvOS))#if os(watchOS))#if os(visionOS))Sources/Extensions/NSButton+Kingfisher.swift - NSButton image loadingSources/Extensions/UIButton+Kingfisher.swift - UIButton extensionsSources/Extensions/WKInterfaceImage+Kingfisher.swift - WatchKit supportSources/Extensions/CPListItem+Kingfisher.swift - CarPlay list items (iOS 14.0+)Sources/Extensions/TVMonogramView+Kingfisher.swift - Apple TV monogram views