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

Support nibs with spaces in name #52

Closed
wants to merge 1 commit into from
Closed

Conversation

tomekc
Copy link

@tomekc tomekc commented Aug 7, 2015

Hello there!
I have a nib in my project named "Launch Screen.xib", which I am pretty sure has been generated by Xcode.

R.swift generated uncompilable code, because using file name as a symbol. Here's a quick fix to differentiate nib name and variable name. Hope it is fine for you :)

@mac-cain13
Copy link
Owner

Thanks for using R.swift and taking the time to fix this issue!

This sounds like something that is fixed in a quite recent release. The Var struct is using the sanitizedSwiftName function and in recent releases this will also strip out spaces of names. So that should already fix this issue.

Could you check which version of R.swift your using and if the current 0.8.4 release has this already fixed? Would be good to know!

Once again thanks for your time!

@tomekc
Copy link
Author

tomekc commented Aug 8, 2015

Hi! I used cocoa pods and believe I used the most recent version (0.8.4).

Interesting, that I forked from master (as you may check) and it didn't work either - which eventually made me creating this patch.

@tomekc
Copy link
Author

tomekc commented Aug 8, 2015

I think I got it. Fix you mentioned was correcting the variable name, not a struct type.

Actual code generated was:

static var launchScreen: _R.nib._Launch Screen { return _R.nib._Launch Screen() }

I probably should have used sanitizedSwiftName function instead of making my own.

@mac-cain13
Copy link
Owner

Aah yeah I see! Thanks for clearing this up! :)

Indeed, the sanitizedSwiftName function should be used and I also want to write a test for this one. Will do that on develop and the next release will fix this. Thanks again for reporting.

@mac-cain13
Copy link
Owner

I've created a seperate issue for this one, will solve it over there and close this PR!

@mac-cain13 mac-cain13 closed this Aug 8, 2015
@mac-cain13
Copy link
Owner

Fixed this in 0.8.5!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants