Combine two Xcode workspaces into one

1.9k Views Asked by At

I have two projects. Project A and Project B. Project A is in Objective C, while the other is in Swift 3.0. Project A is already stable, however a new functionality will be added. Project A is already in a workspace.

Here's where Project B comes into place.

In Project B, I'm developing a library that will be used by Project A. Project B is using external libraries such as Alamofire.

I want Project A to use Project B. What I've tried is to combine these two into Project A's workspace. I placed Project B inside Project A's workspace.

However, Project B's external libraries were not included in the transfer.

I'm using Cocoapods in both projects.

Or do I have to re-add the external libraries?

1

There are 1 best solutions below

1
On

I just managed to get a simpler version of your problem working. I had one existing Cocoapods workspace, that built a framework, that I wanted to combine with another project. I created a new workspace, and then added three projects to it, and then embedded the framework and its dependencies. Let me describe in more detail.

The three projects were as follows:

  • My framework (MyFramework)
  • My framework's dependencies, managed by Cocoa pods (Pods)
  • My New App (MyApp)

The first two, MyFramework and Pods, were from the existing workspace. Got that?

When I created a new workspace, there were basically two steps. First I had to add the above three projects. Then, in the General tab of the MyApp project (in my new workspace), I had to add MyFramework to the "Embed Frameworks" section. That got everything wired up.

As it turned out, in my particular case, I got a crash at runtime which complained about a missing bundle. That bundle was actually a product of the Pods project. I found that bundle on my filesystem and then dragged it into my workspace (which added it to the "Copy Bundle Resources" section of my General tab for MyApp). That got everything working.

In short, I didn't combine two workspaces. Instead, I dismantled the first workspace (in a manner of speaking) and added its parts to a new workspace, which included my new app.

I hope the above gives you a hint as to how to proceed. Good luck!