Jeef
Jeef

Reputation: 27285

Developing a multi-module(framework) project in ios

I'm looking for advice on starting a new development project as what technology to use.

We are starting to build an enterprise iOS8 application which will have multiple models (likely frameworks). Ideally I'd like to be in a situation where certain parts of the code (say some of the algorithm, the data connection portion, and perhaps some specific UI components) are each in their own individual iOS framework so that they can be rescued across projects.

Also, for re-use issues I was hoping to store each individual component in an individual git archive. This leads me to a few options

  1. gitSubModule
  2. CocoaPods
  3. Carthage
  4. git subTree
  5. google repo

I've worked with submodules and I find them awkward and a mess.

Although this might be one of those subjective questions which is thus declared invalid I'm hoping people can share their direct observations with working with these different methodologies

I'd like to pick a method based on the following criteria

(I'm hoping this question doesn't get closed as subjective)

Upvotes: 0

Views: 412

Answers (1)

Max Komarychev
Max Komarychev

Reputation: 2856

Disclaimer: I never used options 3-5.

Submobules are only source code management. They can't provide you convenient /automatic/ way to manage updates and versioning of subprojects. I was using git submodules early in my career to manage dependencies. I had no big issues with them but I must to note I never committed back to submodules. Especially me find submodules a bit awkward. They can handle sources but that is all. In case if the subproject you use in the main app will be updated and new files are added (or existing ones are deleted) you will need to track these changes in main Xcode project - you will need to add new files and delete removed ones.

As for CocoaPods: I have been using them for the last 2.5 years and it works perfect for me. I consider CocoaPods to be mature enough for development. The main advantages:

  • they actually integrate libraries into your main project - the only thing you need is to run pod install (or update) and enjoy the configured workspace.
  • they allow you to use versioning for your subprojects - you can pick specific version, you can use comarison operators to pick version older than xxx, version not older than xxx, etc., you can configure them to pick the latest available commit in the repo
  • they manage depenencies - you may use another cocoapods as dependencies for yours
  • they support components - you may split your single pod into optional components
  • they support private repositories - you may want keep your enterprise components pods private on your own specs repo

The only disadvantage may arise (it is not an issue as for me, but others may argue):

  • cocoapods integration process make changes to your main project file - but only once. I never had an issues with failures in the project file due to cocoapods.

git subTree, google repo I never used this but it has similar disadvantage to submodules - it is only about source control. You need to do integration on your own.

Upvotes: 1

Related Questions