Latest 1.1.4
License MIT
Platforms ios 10.0

Valley, a file downloader written in Swift 4 for iOS


  • Images are downloaded asynchronously.
  • LRU concept to cache management
  • Allows to configure cache size.
  • Has extension for UIImageView
  • Provides closure properties manipulation and error handling.


  • [x] In Memory Cache
  • [ ] Disk Storage Cache
  • [x] Improve cache item size
  • [ ] New extensions (e.g. WKWebView)
  • [x] Travis integration


Setup with CocoaPods (iOS 10+)

If you are using CocoaPods add this text to your Podfile and run pod install.

target 'Your target name'
pod 'Valley'


  1. Add import Valley to your code

  2. From your UIImageView instance, you can just:
    imageView.valleyImage(url: "")
  3. To download other kind of files for example:
    // JSON
    ValleyFile<[[String: Any]]>.request(url: "") { (json) in }

// Data to fill a webview with a PDF
ValleyFile.request(url: "") { (data) in }

## Canceling download

To manually cancel the download, call:
let task = imageView.valleyImage(url: "")

Supply a placeholder image

You can supply an error image that will be used if an error occurs during image download.

imageView.valleyImage(url: "", placeholder: image)


The following method clear all items from cache



Use Valley.setup(capacity: Int) to define a capacity in bytes to cache.

Demo app

The demo iOS app shows how to load images in a collection view with Valley and also load files like JSON.

Alternative solutions

Here is the list of other image download libraries for Swift.


Valley is released under the MIT License.

Feedback is welcome

If you notice any issue, got stuck or just want to chat feel free to create an issue. I will be happy to help you.


Latest podspec

    "name": "Valley",
    "platforms": {
        "ios": "10.0"
    "swift_version": "4.2.0",
    "summary": "A simple loading and caching system for Images, Data and JSONS",
    "version": "1.1.4",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Luciano Bohrer": "[email protected]"
    "homepage": "",
    "source": {
        "git": "",
        "tag": "1.1.4"
    "ios": {
        "frameworks": "Foundation"
    "source_files": "Valley/Source/**/*"

Pin It on Pinterest

Share This