2

If I have a big project and have several features. The features will be developed by another developer independently in another iOS project. The features can include UIViewcontrollers, Navigation and other things what an iOS app normally has. Then I have the main app where the feature projects will be integrated in an xcode workspace. How can I reference the other feature projects from the main app/projects? I tried loading a viewcontroller from a storyboard it seems not finding it. I also tried adding using build phases but I can't make it work.

I read this article Using CocoaPods To Modularize Big iOS Apps. The blog talks about using cocoapods which I am trying to avoid. I don't seem to find something that says it works with SVN which was the reason I wont use it for what I need. There is the framework option but Im looking for a better solution.

naz
  • 1,478
  • 2
  • 21
  • 32
  • why avoid Cocoapods? what is your exact issue encountered? – Raptor Feb 04 '15 at 04:31
  • does it work with SVN? – naz Feb 04 '15 at 04:31
  • 1
    I use Cocoapods & SVN in parallel. So far I don't have any problem yet. What's your problem? – Raptor Feb 04 '15 at 04:32
  • 1
    user1539874: Cocoapods simply requires a Podfile and generates an xcworkspace and a Podfile.lock file. The rest can be ignored by your source control method of choice. It'll work fine with SVN. – Aaron Wojnowski Feb 04 '15 at 04:34
  • My attempts in researching about cocoapods with SVN the results all say some kind of failure. I will try to set it up with CocoaPods then. – naz Feb 04 '15 at 04:37
  • One of the biggest unanswered questions on iOS, in my opinion! How does anybody scale their work?! – fatuhoku Oct 07 '15 at 22:14

3 Answers3

1

Cocoapods can help you integrate your subprojects in one main project. Besides cocoapods, you also need a modularization framework to help you use these subprojects's codes . For example, subproject A need to use subproject B's view controller, but A can't get the .h file in B, this is really a problem. I have an open source modularization framework in iOS named TinyPart, may can help you learn something about modularization in iOS. https://github.com/RyanLeeLY/TinyPart

yao li
  • 11
  • 1
0

You might want to follow a proper pattern where software components are depending on an abstract instead of concrete implementation. Please check out http://www.oodesign.com/dependency-inversion-principle.html

Make the feature as a library project, it then can be developed separately and then stuck in a Sandbox project for development. When it is done, stick it back to your main project.

You should declare an interface (or in Objective-C you call it protocol) for that feature, so your main project knows how to use it. Make a dummy implementation of that protocol, stick it to the main project, so while the library is being developed, you can still go on with your main project's development.

Alex Zavatone
  • 4,106
  • 36
  • 54
Nam Duong
  • 96
  • 1
  • 3
  • 2
    Thanks for the input. Yes I do implement a completely decoupled architecture which resembles the SOLID arch. I am applying it on my projects and my issue now is the above implementation. Yes, I may integrate the feature project as frameworks or by other means as long as I can link and build them as one. Once I get to make this work then I would have less problem when working with the rest of my team. – naz Feb 04 '15 at 06:19
  • How have you got on with modularizing your app? Have you found any particularly good ways of doing this? – fatuhoku Nov 13 '15 at 21:37
0

have a look here for how to load other storyboard's view controllers from another project/framework. Not sure if its exactly what you are looking for but it seems like a similar problem

In your case under the guide linked in the link above, have a look at Developing the Framework as a Dependent Project

Community
  • 1
  • 1
Fonix
  • 11,447
  • 3
  • 45
  • 74