Skip to content

comquas/CQImageDownloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

With CocoaPod

add

pod "CQImageDownloader"

Manual

copy to CQImageDownloader/Classes/CQImageDownloader.swift to your project.

Usage

Download and Show

imageView.setCQImage("https://unsplash.com/photos/BO5BswJwguI/download?force=true")
imageView.setCQImage("https://unsplash.com/photos/BO5BswJwguI/download?force=true", placeholder: placeholderImage)

Downloading with progress

imageView.setCQImage("https://unsplash.com/photos/BO5BswJwguI/download?force=true", placeholder: nil, progress: { (value: Float) in

    //supporting progress        
    print(value)
            
})

Downloading with completion

imageView.setCQImage("https://unsplash.com/photos/BO5BswJwguI/download?force=true", placeholder: nil, progress: nil, completion: { (image:UIImage?, success:Bool) in

    if (success) {

    }

})

Clear Cache

CQImageDownloader.clearAllTheCachedImages()
var downloader = CQImageDownloader()
downloader.deleteCacheImage("file URL")