Storyboard reference to a different project

I’m having a difficult time trying to figuring out how to make a storyboard reference work with storyboard from other project. I’m trying to modularize my App, so I’m creating multiple projects inside Xcode workspace. The point is that at some times, one storyboard from project A may have a reference to a storyboard in project B… I thought that the reason for the ‘BUNDLE’ option in a storyboard reference is that you could achieve what I’ve mentioned… I’ve attached an image that explain better what I’m saying… When I try to run, the app links to the Main.storyboard from Project A instead Main.storyboard from Project B…

I’ve checked and rechecked to make sure that bundle name is correct…

@cleversou Thanks very much for your question!

If you’re trying to modularize your app, then you shouldn’t be trying to make accessible your storyboard from within your project, outside of it. If you’ve worked with other third-party libraries and/or Cocoapods, you will see that these projects make their code available to be used within your own project. In other words, there should be a certain level of encapsulation that would prevent the user from seeing the inner goings of your project. All your project should do is provide tools for you to use in your project, without allowing the user to access, to know, or even care how you’ve accomplished this. In my humble opinion, you should work on the design of your project so that at no point does the user need to access the storyboard from within the project. They should be able to simply import a particular class so that they may use the functionality, and that is it.

I hope this helps!

All the best!

Hello Friend! Many thanks for trying to help me!

Maybe I have expressed poorly about modularization … The app I am developing contains features, which despite the same name, have different functions in the side of it, so I was using projects inside a workspace to be able to separate the application without problems (namespaces) and also to make it easier to work in each area of it separately, and then make that “link” between the storyboards of each project, that’s what I’m trying to do, but the Base project does not seem to have access other projects. The strange thing is that when searching the Internet, I saw that some people have managed to do this … But when I try on may application, it crashes:

2017-10-09 10:14:08.935 Base[1633:315609] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: 'Could not find a storyboard named ‘Test’ in bundle NSBundle

I’m guessing the runtime is searching in the current Bundle, and not the one I’ve specified in the storyboard reference…

Thanks again, friend!

All the best!

@cleversou Thanks very much for your kind words. My advice would be to post your question with the details on stackoverflow, and more than likely you’ll get a solution within 24 hours.

I hope this helps!

All the best!

Thanks again, my friend! I’ve tried to post on the stackoverflow site, without success yet … Still, I thank you for your time and effort in trying to help me!

All the best!

This topic was automatically closed after 166 days. New replies are no longer allowed.