Latest 1.1.0
License MIT
Platforms ios 9.0, requires ARC

Build Status [CocoaPods]() [license]()


YNImageAsync is a lightweight and convenient framework for fetching and caching images.


  • Written on Swift 3.0
  • Asynchronous image loading
  • Fast
  • Supports both memory and drive caching
  • Configurable
  • Unit test coverage is good
  • UIImageView extension for fast and out-of-the-box image loading.

Why not %framework_name%?

Here are some results of performing 10k requests by popular frameworks:

(smaller time is better)
You can check it by yourself by launching this benchmark project tests.


Using cocoapods

pod 'YNImageAsync'

How to

Set UIImageview image with url

if let url = URL(string: "") {

Cancel UIImageview previous loading operation


Access cache directly

// Initialize cache with 30 Mb memory capacity and disk caching
let cacheProvider = CacheProvider(configuration: CacheConfiguration(options: [.memory, .disk], memoryCacheLimit: 30 * 1024 * 1024)) 

// Save cache to memory and disk
cacheProvider.cacheData("key", data) 

// Get cached data for key
provider.cacheForKey("key", completion: { (data) in
    if let cacheData = data {
        print("Cache hit")
    } else {
        print("Cache miss")

Change memory cache capacity

You don’t need to initialize new instance of cache provider in order to change maximum memory cache capacity.

// New memory capacity is 10 Mb
let newLimit: Int64 = 10 * 1024 * 1024        
provider.configuration.memoryCacheLimit = newLimit
// Perform memory clean operation if capacity was reduced

Configure storage type

You can easily configure storage during initialization and during runtime as well

provider.configuration.options = .memory


  • XCode 8
  • Swift 3
  • iOS 9


YNImageAsync is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "YNImageAsync",
    "version": "1.1.0",
    "summary": "Lightweight image loading and caching framework",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Yury Nechaev": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.1.0"
    "source_files": "YNImageAsync/**/*.{swift,h}",
    "requires_arc": true,
    "platforms": {
        "ios": "9.0"
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This