Skip to content

Instantly share code, notes, and snippets.

@kevinw
Created June 5, 2014 01:27
Show Gist options
  • Save kevinw/5511b384c3bf33e469f2 to your computer and use it in GitHub Desktop.
Save kevinw/5511b384c3bf33e469f2 to your computer and use it in GitHub Desktop.
+ (UIImage *)imageNamed:(NSString *)imageName
fromBytes:(const Byte *)bytes
length:(NSUInteger)length
fromRetinaBytes:(const Byte *)retinaBytes
retinaLength:(NSUInteger)retinaLength {
NSString *bundleName = [FBSettings resourceBundleName];
if (bundleName) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"%@.bundle/%@", bundleName, imageName]];
if (image) {
return image;
}
}
return [FBImageResourceLoader imageFromBytes:bytes
length:length
fromRetinaBytes:retinaBytes
retinaLength:retinaLength];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment