Skip to content

Instantly share code, notes, and snippets.

@AmitaiB
Last active August 29, 2015 14:28
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 AmitaiB/b9a716e7b6a6b4b98558 to your computer and use it in GitHub Desktop.
Save AmitaiB/b9a716e7b6a6b4b98558 to your computer and use it in GitHub Desktop.
shortens getting a UIImage from the string of a URL
#import <UIKit/UIKit.h>
@interface UIImage (FromURL)
+(UIImage*)imageWithContentsOfURLString:(NSString*)URLString;
@end
//*************************************
#import "UIImage+FromURL.h"
@implementation UIImage (FromURL)
+(UIImage*)imageWithContentsOfURLString:(NSString*)URLString {
return [UIImage imageWithCIImage:[CIImage imageWithContentsOfURL:[NSURL URLWithString:URLString]]];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment