CocoaPods is the recommended way to add DLImageLoader to your project.
- Add a pod entry for DLImageLoader to your Podfile
pod 'DLImageLoader', '~> 2.2.0' - Install the pod(s) by running
pod install. - Include DLImageLoader wherever you need it with
#import "DLIL.h"(e.g. SomeViewController.m or AppName-Prefix.pch).
Alternatively you can directly add the DLImageLoader folder to your project.
- Download the latest code version or add the repository as a git submodule to your git-tracked project.
- Open your project in Xcode, then drag and drop
DLImageLoaderfolder 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. - Include DLImageLoader wherever you need it with
#import "DLIL.h"(e.g. SomeViewController.m or AppName-Prefix.pch).
[[DLImageLoader sharedInstance] imageFromUrl:@"image_url_here"
imageView:@"UIImageView here"];
[[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
}];
// === With using of DLImageLoader instance === //
[[DLImageLoader sharedInstance] cancelOperation:@"image_url_here"];
[[DLImageLoader sharedInstance] cancelAllOperations];
// === With using of DLImageView === //
[DLImageView cancelLoading];