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

Create bundle #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Create bundle #54

wants to merge 1 commit into from

Conversation

ytakzk
Copy link

@ytakzk ytakzk commented Apr 30, 2015

In NMRangeSlider.m, images are loaded from a bundle named NMRangeSlider, but it doesn't has such a bundle so I create NMRangeSlider bundle.
It will be helpful for Swift projects.

@chanil1218
Copy link

In my case, this commit fixes #56 slider is not shown bug.
I am using CocoaPods and I think images in this project may not be loaded to CocoaPods unless using bundle(And without use_frameworks! option, master branch also show slider properly).

So, if you need use_frameworks! options, then use this @ytakzk's version before it is merged into master.
By following code,

pod 'NMRangeSlider', :git => 'https://github.com/ytakzk/NMRangeSlider.git', :branch => 'create_bundle'

@chanil1218
Copy link

@ytakzk Shouldn't we change

- (UIImage *)imageFromBundle:(NSString*)imageName {
    NSBundle* bundle = [NSBundle bundleForClass:[NMRangeSlider class]];
    NSString *imagePath = [bundle pathForResource:imageName ofType:@"png"];
    UIImage *image = [UIImage imageWithContentsOfFile:imagePath];
    return image;
}

bundle search path?

Like this link

NSString *bundlePath             = [[NSBundle mainBundle] pathForResource:@"MyBundle" ofType:@"bundle"];
NSBundle *bundle                 = [NSBundle bundleWithPath:bundlePath];

@ytakzk
Copy link
Author

ytakzk commented Jun 21, 2015

@chanil1218 Sorry, what do you mean by that?
I confirmed that the fixed code worked well for Swift.

@chanil1218
Copy link

@ytakzk checkout #56 issue.
I thought your commit fixes the problem.
But images are sometime nil and I suspect it is because wrong bundle reference.

In my commit - https://github.com/chanil1218/NMRangeSlider/commit/c89890cc60d2328122d41e369a4e30aafb1b008b, I changed structure regarding resources bundle, and I confirmed it works.
(I reference https://github.com/JonasGessner/JGProgressHUD using resource bundle)

So, the question I want to ask you is,

NSBundle* bundle = [NSBundle bundleForClass:[NMRangeSlider class]];

Is this reference proper for s.ios.resource_bundle.

I am not sure my claim is correct, but it seems that your change using CocoaPods bundle make image nil sometimes.

@jlaws
Copy link

jlaws commented Nov 8, 2015

Can we get one of these two solutions integrated and a new pod sent out?

@nardoguy14
Copy link

so is this going to be merged :/?

@rafcabezas
Copy link

rafcabezas commented Jun 24, 2016

I second the request to merge this pull request. It's not ideal to have the hack in my Podfile forever.
(pod 'NMRangeSlider', :git => 'https://github.com/chanil1218/NMRangeSlider.git', :commit => 'c89890c')

Update: just do pod 'NMRangeSlider', :git => 'https://github.com/muZZkat/NMRangeSlider.git'

@philippelatulippe
Copy link

chanil1218 seems to have deleted their fork.

@skerkewitz
Copy link

Yeah, same problem here. We probably should have forked @chanil1218 branch ^^

@rafcabezas
Copy link

rafcabezas commented Jul 1, 2016

Hm. Let's try this:
pod 'NMRangeSlider', :git => 'https://github.com/muZZkat/NMRangeSlider.git'

Update: It works for me.

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.

7 participants