Skip to content
A bare-bones library for downloading and caching images.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
NetworkImageLoader.xcodeproj
NetworkImageLoader
NetworkImageLoaderTests
.gitignore
LICENSE
README.md

README.md

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)
You can’t perform that action at this time.