InterProject communication in XCode
Asked Answered
M

1

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?

Militant answered 21/8, 2015 at 16:29 Comment(7)
Kindly let me know if this approach is feasible? Anyone has worked on similar requirements?Militant
Did you try CocoaPods?Hemicycle
@Visput - No i haven't tried with that... Would that be the optimal solution?Militant
Yes, it will easily manage your situation. If you want I can provide example of how to configure it to handle your scenario.Hemicycle
@Visput could you please share an exampleMilitant
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 guides.cocoapods.org/syntax/podspec.htmlWiegand
thank u.. will try it.Militant
C
-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.

Crista answered 31/8, 2015 at 8:16 Comment(1)
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.Militant

© 2022 - 2024 — McMap. All rights reserved.