Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load resources from framework #111

Closed
wants to merge 2 commits into from
Closed

Load resources from framework #111

wants to merge 2 commits into from

Conversation

scinfu
Copy link

@scinfu scinfu commented Oct 2, 2014

If this library is linked into a framework all resources will not be found ,the right way to load images is to use this api
imageNamed:(NSString *) inBundle:(NSBundle *) compatibleWithTraitCollection:(UITraitCollection *)
but is supported only in iOS8 .

I fix this issue using [[NSBundle bundleForClass:[self class]]resourcePath]>

@allaire
Copy link

allaire commented May 13, 2015

@scinfu Was the "2x" if really required?

Might be cleaner to do:

UIImage *image = [UIImage imageWithData:[NSData dataWithContentsOfFile:imagePath] scale:[UIScreen mainScreen].scale];

@allaire
Copy link

allaire commented May 13, 2015

Just opened a new PR with less code, it loads retina images correctly: #131

@scinfu scinfu closed this Apr 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants