What problem does it solve?
This Skill provides a robust solution for efficiently loading and caching images in SwiftUI applications, addressing the limitations of the built-in AsyncImage by implementing memory and disk caching, request deduplication, and optional image processing.
Core Features & Use Cases
- Advanced Caching: Utilizes
NSCache for memory and LRU FileManager for disk caching to reduce network requests and improve performance.
- Deduplication: Prevents redundant downloads when the same image URL is requested multiple times concurrently.
- Image Processing: Supports resizing and thumbnail generation to optimize memory usage and display.
- Drop-in Replacement: Offers a
CachedAsyncImage SwiftUI view that can replace AsyncImage with minimal code changes.
- Use Case: Integrate this skill into your app to ensure smooth scrolling through image-heavy lists, faster loading times, and reduced data consumption by intelligently managing image assets.
Quick Start
Use the image-loading skill to add a production-ready image loading pipeline with caching and a CachedAsyncImage SwiftUI view.