Kingfisher is a modern Swift library for loading and caching images, built with a modular structure and protocol-oriented design. The project clearly separates different concerns and uses a namespace pattern (.kf) to provide a consistent API for UIKit, AppKit, and SwiftUI. Its core components include KingfisherManager as the central coordinator, ImageDownloader for handling network tasks, ImageCache for a dual-layer caching system, and ImageProcessor for managing image transformation pipelines.
The project supports multiple platforms (iOS, macOS, tvOS, watchOS, visionOS) and uses Fastlane as its main build system. It employs the XCTest framework for testing and integrates the DocC documentation system. Files are organized based on functionality, with the Sources directory divided by modules, configuration files centrally managed, and Demo projects offering complete usage examples.
Sources/General/KingfisherManager.swift - Central coordinator managing image loading workflowSources/General/KF.swift - Main entry point providing builder pattern API for image tasksSources/General/Kingfisher.swift - Core framework module with KingfisherCompatible protocolSources/General/KingfisherOptionsInfo.swift - Configuration options container for all operationsSources/General/KingfisherError.swift - Error handling system with detailed error typesSources/General/KFOptionsSetter.swift - Options configuration builder for method chainingSources/General/ImageSource/Resource.swift - URL resource definitions and transformationsSources/General/ImageSource/Source.swift - Abstract image source protocols and implementationsSources/General/ImageSource/ImageDataProvider.swift - Data provider protocol for custom image sourcesSources/General/ImageSource/AVAssetImageDataProvider.swift - AVAsset image frame extractionSources/General/ImageSource/PHPickerResultImageDataProvider.swift - Photo picker integrationSources/General/ImageSource/LivePhotoSource.swift - Live Photo support implementationSources/Networking/ImageDownloader.swift - HTTP image downloading with session managementSources/Networking/ImageDownloader+LivePhoto.swift - Live Photo downloading extensionsSources/Networking/ImageDownloaderDelegate.swift - Download progress and completion delegationSources/Networking/SessionDelegate.swift - URLSession delegate handling authentication and redirectsSources/Networking/SessionDataTask.swift - Custom data task wrapper with cancellation supportSources/Networking/ImagePrefetcher.swift - Batch image prefetching for performance optimizationSources/Networking/RequestModifier.swift - HTTP request modification protocolsSources/Networking/ImageModifier.swift - Response image modification protocolsSources/Networking/RedirectHandler.swift - HTTP redirect handling strategiesSources/Networking/RetryStrategy.swift - Failed request retry logic and policiesSources/Networking/AuthenticationChallengeResponsable.swift - Authentication challenge handlingSources/Networking/ImageDataProcessor.swift - Raw image data processing pipelineSources/Cache/ImageCache.swift - Dual-layer (memory + disk) caching coordinatorSources/Cache/MemoryStorage.swift - In-memory LRU cache with automatic cleanupSources/Cache/DiskStorage.swift - Persistent disk storage with expiration policiesSources/Cache/Storage.swift - Abstract storage protocols and configurationsSources/Cache/CacheSerializer.swift - Image serialization for disk persistenceSources/Cache/FormatIndicatedCacheSerializer.swift - Format-aware image serializationSources/Image/Image.swift - Cross-platform image type definitions and utilitiesSources/Image/ImageProcessor.swift - Image transformation and processing pipelineSources/Image/Filter.swift - Built-in image filters (blur, tint, overlay, etc.)Sources/Image/ImageFormat.swift - Image format detection and handlingSources/Image/ImageDrawing.swift - Core graphics drawing utilities and extensionsSources/Image/ImageTransition.swift - View transition animations for image loadingSources/Image/ImageProgressive.swift - Progressive JPEG loading implementationSources/Image/GIFAnimatedImage.swift - GIF animation support and playbackSources/Image/GraphicsContext.swift - Graphics context management and utilitiesSources/Image/Placeholder.swift - Placeholder image definitions and protocolsSources/Extensions/ImageView+Kingfisher.swift - UIImageView integration with .kf namespaceSources/Extensions/UIButton+Kingfisher.swift - UIButton background/image loading supportSources/Extensions/NSTextAttachment+Kingfisher.swift - Text attachment image loadingSources/Extensions/NSButton+Kingfisher.swift - macOS NSButton image loading integrationSources/Extensions/HasImageComponent+Kingfisher.swift - Generic image component protocolSources/Extensions/PHLivePhotoView+Kingfisher.swift - Live Photo view integrationSources/Extensions/CPListItem+Kingfisher.swift - CarPlay list item supportSources/SwiftUI/KFImage.swift - Main SwiftUI image view componentSources/SwiftUI/KFAnimatedImage.swift - Animated image support for SwiftUISources/SwiftUI/KFImageOptions.swift - SwiftUI-specific configuration optionsSources/SwiftUI/KFImageProtocol.swift - Shared protocol for KF SwiftUI componentsSources/SwiftUI/KFImageRenderer.swift - SwiftUI view rendering and update logicSources/SwiftUI/ImageBinder.swift - Binding layer between SwiftUI and Kingfisher coreSources/SwiftUI/ImageContext.swift - SwiftUI image loading context managementSources/Views/AnimatedImageView.swift - Custom animated image view for GIF playbackSources/Views/Indicator.swift - Loading indicator views and protocolsPackage.swift - Swift Package Manager manifest with dependencies and targetsPackage@swift-5.9.swift - Swift 5.9 compatibility package manifestKingfisher.podspec - CocoaPods specification for distributionGemfile - Ruby dependencies for Fastlane and build toolsGemfile.lock - Locked Ruby gem versions for reproducible buildsfastlane/Fastfile - Main Fastlane configuration with lanes for testing, building, and releasingfastlane/actions/extract_current_change_log.rb - Extracts current version changelogfastlane/actions/git_commit_all.rb - Git commit automation with custom messagesfastlane/actions/sync_build_number_to_git.rb - Synchronizes build numbers with git commitsfastlane/actions/update_change_log.rb - Automated changelog managementfastlane/README.md - Fastlane documentation and usage instructionsKingfisher.xcodeproj/ - Main Xcode project with targets and build settingsKingfisher.xcworkspace/ - Xcode workspace for integrated developmentDemo/Kingfisher-Demo.xcodeproj/ - Demo application Xcode projectSources/Info.plist - Framework bundle information and version metadataSources/PrivacyInfo.xcprivacy - Privacy manifest for App Store complianceimages/ - Sample images for testing and demo applications
kingfisher-1.jpg through kingfisher-10.jpg - Test image assetslogo.png - Project logo and brandingTests/KingfisherTests/dancing-banana.gif - GIF test asset for animation testingTests/KingfisherTests/single-frame.gif - Single-frame GIF for edge case testingDemo/Demo/Kingfisher-Demo/ - iOS demo app showcasing all features
ViewControllers/ - Various demo screens (GIF, transitions, processors, etc.)SwiftUIViews/ - SwiftUI demonstration views and regression testsDemo/Demo/Kingfisher-macOS-Demo/ - macOS demo applicationDemo/Demo/Kingfisher-tvOS-Demo/ - Apple TV demo applicationDemo/Demo/Kingfisher-watchOS-Demo/ - watchOS demo applicationpre-change.yml - Pre-commit hook configuration for code quality.gitignore - Git ignore patterns for build artifacts and dependenciesSources/Utility/ExtensionHelpers.swift - Cross-platform compatibility helpersSources/Utility/CallbackQueue.swift - Thread-safe callback queue managementSources/Utility/Box.swift - Reference wrapper for value typesSources/Utility/Result.swift - Result type utilities and extensionsSources/Utility/Delegate.swift - Weak delegate wrapper to prevent retain cyclesSources/Utility/Runtime.swift - Runtime reflection and dynamic dispatch utilitiesSources/Utility/DisplayLink.swift - Cross-platform display link abstractionSources/Utility/SizeExtensions.swift - CGSize manipulation and calculationsSources/Utility/String+SHA256.swift - String hashing for cache key generationTests/KingfisherTests/KingfisherTestHelper.swift - Shared testing utilities and mocksTests/KingfisherTests/Utils/StubHelpers.swift - HTTP stubbing helpers for network testsTests/Dependency/Nocilla/ - HTTP mocking framework for isolated testingSources/Documentation.docc/ - DocC documentation bundle
Documentation.md - Main documentation entry pointGettingStarted.md - Quick start guide for new usersTutorials/ - Step-by-step tutorials for UIKit and SwiftUICommonTasks/ - Task-oriented documentation for common use casesTopics/ - Advanced topic guides (prefetching, indicators, etc.)Resources/ - Documentation assets, images, and code samples.kf property extension-able for capabilities (e.g., AuthenticationChallengeResponsable)UIButton+Kingfisher.swift)Tests suffix.kf namespaceKingfisherOptionsInfoResult<Success, KingfisherError>