How to handle two projects in Xcode8?

73 Views Asked by At

I have two projects called Project A and Project B. Both projects have different pod files.

Now I want to add Project B into Project A. So my Project A is final code and I want to use a Project B files in Project A and vice versa. So How can I achieve it in Xcode8?

1

There are 1 best solutions below

1
On

Create a workspace with both Projects A and B.

When you write your POD file, you can set the workspace file, the project file and the build target.

For example:

project '../Source/Rnd_Lab(iOS).xcodeproj/'
workspace 'RND(iOS).xcworkspace/'

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'RND' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for RND
  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'Firebase/Storage'

end

Targets the Rnd_Lab(iOS).xcodeproj project in a completely other directory and sets the pods to target RND. Then, it writes all of these settings to the specified RND(iOS).xcworkspace. This workspace is the one you would have already setup with projects A and B.