6

My project architecture is, a workspace which has two projects(Project A & Project B). Project A has three more sub projects(Project X , Project Y, Project Z).

  • Workspace
    • Project A
      • Project x
      • Project y
      • Project z
    • Project B

Project B is more a kind of utility project. It needs to be re used in Project A, Project x,Project y, Project z and elsewhere it could be. I am starting to do a prototype. But face challenges in linking Project B in other projects. Every time i need to add the .a file manually into all other projects. Do we have any solution to dynamically link?

I tried this approach as well. I moved project B inside Project A below Project z. But i was not able to access the classes in Project x, y, z because all the projects are in the same level.

Any solution to dynamically link projects in the same level?

vivin
  • 992
  • 1
  • 8
  • 24
  • Kindly let me know if this approach is feasible? Anyone has worked on similar requirements? – vivin Aug 24 '15 at 15:00
  • Did you try CocoaPods? – Vlad Papko Aug 24 '15 at 15:21
  • @Visput - No i haven't tried with that... Would that be the optimal solution? – vivin Aug 24 '15 at 16:07
  • Yes, it will easily manage your situation. If you want I can provide example of how to configure it to handle your scenario. – Vlad Papko Aug 24 '15 at 16:35
  • @Visput could you please share an example – vivin Aug 24 '15 at 18:19
  • 1
    Not taking the bounty *(@Visput, are you willing to write a step by step tutorial on SO?)*, the idea is to transform one or more .xcodeproj into **Pods**, starting with `pod spec create`, then create a `Podfile` at the client level, pointing to a local directory. Some documentation on https://guides.cocoapods.org/syntax/podspec.html – SwiftArchitect Aug 26 '15 at 20:37
  • thank u.. will try it. – vivin Aug 27 '15 at 14:48

1 Answers1

-1

You need to add Project B as Target Dependency from Build Phases to other projects, that way Project B is built and added to other projects just as you'd like.

Mert Buran
  • 2,989
  • 2
  • 22
  • 34
  • I am not able to add it Project B as Target Dependency for Project A. If projects are in the same level, we are not able to make one dependent of another, Only if a Project is inside another project, we can make the parent project dependent on child. – vivin Aug 31 '15 at 15:44