Skip to content

AndreyLunevich/DLImageLoader-iOS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

67 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DLImageLoader-Objective-C

Installation

Cocoapods

CocoaPods is the recommended way to add DLImageLoader to your project.

  1. Add a pod entry for DLImageLoader to your Podfile pod 'DLImageLoader', '~> 2.2.0'
  2. Install the pod(s) by running pod install.
  3. Include DLImageLoader wherever you need it with #import "DLIL.h" (e.g. SomeViewController.m or AppName-Prefix.pch).

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.
  3. Include DLImageLoader wherever you need it with #import "DLIL.h" (e.g. SomeViewController.m or AppName-Prefix.pch).

Usage

Simple

[[DLImageLoader sharedInstance] imageFromUrl:@"image_url_here"
                                   imageView:@"UIImageView here"];

Complete

[[DLImageLoader sharedInstance] imageFromUrl:@"image_url_here"
                                   completed:^(NSError *error, UIImage *image) {
                                      if (error == nil) {
                                        // if we have no any errors
                                      } else {
                                        // if we got an error when load an image
                                      }
                                   }];
[[DLImageLoader sharedInstance] imageFromUrl:@"image_url_here"
                                   completed:^(NSError *error, UIImage *image) {
                                    if (error == nil) {
                                      // if we have no any errors
                                    } else {
                                      // if we got an error when load an image
                                    }
                                   } canceled:^{
                                    // 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];

About

Image Loader for iOS on swift and objective-c languages

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors