Skip to content

Instantly share code, notes, and snippets.

@petermolnar-dev
Created January 26, 2017 20:31
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/e5f015aa8e0b7f0c9eed21d5d11116c4 to your computer and use it in GitHub Desktop.
Save petermolnar-dev/e5f015aa8e0b7f0c9eed21d5d11116c4 to your computer and use it in GitHub Desktop.
PMOPictureController.h - Block based solution
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface PMOPictureController : NSObject
/**
The designated initializer, the picture's url is mandatory to pass.
@param url The picture full url, as NSURL
@return An instance PMOPictureController.
*/
- (nonnull instancetype)initWithPictureURL:(nonnull NSURL *)url NS_DESIGNATED_INITIALIZER;
/**
Start the asynchron download of the image.
*/
- (void)downloadImage;
/**
A high level, public API function to retrieve the image as UIImage
@return an instance of UIImage.
*/
- (nullable UIImage *)image;
/**
Removing the default initalizer
@return nil
*/
- (nullable instancetype)init NS_UNAVAILABLE;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment