Skip to content

Commit

Permalink
Fix image bundle path error if the pod use frameworks.
Browse files Browse the repository at this point in the history
  • Loading branch information
1and2papa committed Mar 17, 2015
1 parent 39861bf commit aadc946
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CTAssetsPickerController/UIImage+CTAssetsPickerController.m
Expand Up @@ -7,12 +7,20 @@
//

#import "UIImage+CTAssetsPickerController.h"
#import "NSBundle+CTAssetsPickerController.h"

@implementation UIImage (CTAssetsPickerController)

+ (UIImage *)ctassetsPickerControllerImageNamed:(NSString *)name
{
return [UIImage imageNamed:[NSString stringWithFormat:@"CTAssetsPickerController.bundle/%@", name]];
if ([UIImage respondsToSelector:@selector(imageNamed:inBundle:compatibleWithTraitCollection:)])
{
return [UIImage imageNamed:name inBundle:[NSBundle ctassetsPickerControllerBundle] compatibleWithTraitCollection:nil];
}
else
{
return [UIImage imageNamed:[NSString stringWithFormat:@"CTAssetsPickerController.bundle/%@", name]];
}
}

@end

0 comments on commit aadc946

Please sign in to comment.