Skip to content

Instantly share code, notes, and snippets.

@petermolnar-dev
Created January 26, 2017 21:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petermolnar-dev/2900a9c527ebb874699262051efbfa97 to your computer and use it in GitHub Desktop.
Save petermolnar-dev/2900a9c527ebb874699262051efbfa97 to your computer and use it in GitHub Desktop.
PMODownloader.h - Block based solution
#import <Foundation/Foundation.h>
@interface PMODownloader : NSObject
//1
/**
The download method, which triggers the download from the parameter url, and executes the passed block in case of the succesful download.
@param url the URL of the downloadable resource
@param callback the callback block, which will be executed with succesfull download
*/
- (void)downloadDataFromURL:(nonnull NSURL *)url completionHander:(void(^_Nonnull)(NSData * _Nullable downloadedData))callback;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment