Storyboards: module name for target may not match "customModule" set by Xcode #25
Comments
@juli1quere care to add some more information about this issue you encountered, or even a sample project to reproduce? Thanks. |
OK, this issue is a little bit strange. I wanted to build a demo project ... But everything is working as expected (i.e. SwiftGen do not add the module name). So, I dug into my original project. When I check with interface builder, my scenes are not set up with a custom module. But when I open it as an XML file,
After removing all these |
Should we close this then? Or is it worth making a note somewhere to document this Interface Builder issue? |
So @djbe: the solution for you would be to check that your scenes are not bound to a specific module. And you'll have to check in Interface Builder AND with XML editor :/ Edit: @AliSoftware just told me that you're not facing this issue ... Anyway :) |
@juli1quere I think this is the behaviour Interface Builder is meant to have. Even if it's not, that doesn't mean we can can't do anything about it. We could modify the following line: Essentialy, you could add a cli parameter |
By the way, you could test this right now using a custom template. With SwiftGen 4.2, you can pass along any custom parameters to the template. |
Indeed, that could be a good option ! In fact, I think this IB issue is not transitory. I manually fixed my storyboard. Few days after, I updated it (just changed the content mode of an
I'll try the solution you suggest quickly. |
So @djbe: I tried your workaround, it works perfectly. Thank you ! Now, I will try to understand why IB continue to add the |
I honestly think they just made it the default behaviour to avoid some class name ambiguity? Ref #2. |
Do you want me to make a PR with your workaround ? |
Err sorry, getting some issues/PRs confused. Yes, a PR would be welcome! |
@juli1quere Any update on this? |
Hey ! I'm sorry, I did not seen the notifications on this. PR incoming 👨🚀 |
If a project has 2 targets A and B, and a storyboard file is in both, whenever a scene's custom class is set in Xcode's UI, the
customModule
will also be (automatically) set to the current target's name in the storyboard's XML.SwiftGen (by default) will preprend the module's name if there is one in the storyboard's XML, so this realisation above means that it will prepend the module name to any custom class, which does not allow generated files to be included by both targets A and B.
The text was updated successfully, but these errors were encountered: