Skip to content
No description, website, or topics provided.
Objective-C Ruby
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.
Example
RMDownloadAdapter
.gitignore
.travis.yml
LICENSE
README.md
RMDownloadAdapter.podspec
_Pods.xcodeproj

README.md

RMDownloadAdapter

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

or

From your terminal, if you have cocoapods installed - run this command

pod try RMDownloadAdapter

If you do not have cocoapods, then first install it by running this command

sudo gem install cocoapods

Requirements

Installation

RMDownloadAdapter is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "RMDownloadAdapter"

or just download/clone this repo and copy past the class files

To use, simply import into your implementation file

#import <RMDownloadAdapter/RMDownloadAdapter.h>

Create and use the RMDownloadAdapter by init, or use the sharedInstance if sharing Cache among different controllers and calling the start download or cancel methods with an optional progress and a mandatory completion handler

RMDownloadAdapter *downloadAdapter = [[RMDownloadAdapter alloc] init];

NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];

RMDownloadAdapterCompletionBlock completionBlock = ^(id object, NSError *error) {
    imageView.image = object;
};

[downloadAdapter startDownloadWithURLString:@"https://i.redd.it/2tm3btii5g0y.jpg" withClass:[UIImage class] indexPath:indexPath progressBlock:nil completionBlock:completionBlock];

or

NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:0];

RMDownloadAdapterCompletionBlock completionBlock = ^(id object, NSError *error) {
    imageView.image = object;
};

[[RMDownloadAdapter sharedInstance] startDownloadWithURLString:@"https://i.redd.it/2tm3btii5g0y.jpg" withClass:[UIImage class] indexPath:indexPath progressBlock:nil completionBlock:completionBlock];

Author

rjmiller2543, MBA11

License

RMDownloadAdapter is available under the MIT license. See the LICENSE file for more info.

You can’t perform that action at this time.