Skip to content

Latest commit

 

History

History
27 lines (23 loc) · 508 Bytes

README.md

File metadata and controls

27 lines (23 loc) · 508 Bytes

NetworkImageLoader

Usage

General

let task = NetworkImageLoader.shared.downloadAndCacheImage(withUrl: imageUrl) { (image, error) in
    guard let image = image else {
        print(error?.localizedDescription ?? "Error downloading image.")
        return
    }
    print(image)
}

UIImageView

imageView.setImage(withUrl: imageUrl)
imageView.cancelImageDownload()

Prefetching

NetworkImageLoader.shared.prefetchImage(withUrl: imageUrl)