DLImageLoader-Swift 1.0.0-swift

DLImageLoader-Swift 1.0.0-swift

TestsTested
LangLanguage SwiftSwift
License Apache 2
ReleasedLast Release Sep 2015
SPMSupports SPM

Maintained by Andrew Lunevich.



  • By
  • Andrew Lunevich

Installation

Source files

Alternatively you can directly add the DLImageLoader folder to your project.

  1. Download the latest code version or add the repository as a git submodule to your git-tracked project.
  2. Open your project in Xcode, then drag and drop DLImageLoader folder onto your project (use the "Product Navigator view"). Make sure to select Copy items when asked if you extracted the code archive outside of your project.

Usage

Simple

DLImageLoader.sharedInstance.displayImageFromUrl("image_url_here", imageView: "UIImageView here")

Complete

DLImageLoader.sharedInstance.loadImageFromUrl("image_url_here") { (error, image) -> () in
    if (error == nil) {
        // if we have no any errors
    } else {
        // if we got an error when load an image
    }
}
DLImageLoader.sharedInstance.loadImageFromUrl("image_url_here", completed: { (error, image) -> () in
    if (error == nil) {
        // if we have no any errors
    } else {
        // if we got an error when load an image
    }
}) { () -> () in
    // image loading was canceled
}

Cancel loading operations

// === With using of DLImageLoader instance === //

DLImageLoader.sharedInstance.cancelOperation("image_url_here")
DLImageLoader.sharedInstance.cancelAllOperations()

// === With using of DLImageView === //

DLImageView.cancelLoading()