Creating multiple projects in one Xcode project

Hi friends, in this blog we will discuss about how multiple projects are handled in iOS.

🎯 Challenges which we face with single project.

How can you create a multiple project in one Xcode project?

first we will look what you mean by workspace and xcodeproj

*.xcworkspace:-

1. xcworkspace folder contains these project 2. Data in contents.xcworkspacedata with empty workspcae

*.xcodeproj:-

Steps involved in adding multiple project:-

2. To add framework follow bellow steps.

3. Create plugin file which acts as interface between the app and framework

iosNote: class and method used in plugin file which need to be accessed from different module should have open/public access specifier. To know about it click here

4. Add your framework as dependency to your app

4. Create a view controller to test

How to use xcworkspace for adding multiple project:-

3. Add name and store the workspace. It creates empty workspace for you. Now your app folder look like this

4. Select File -> New -> this time instead of selecting workspace select project -> select app -> give project name (e.g WorkSpaceTest)-> select workspace where you need to add project under Add to

5. Now your project is added to the workspace and you check the location of the project in contents.xcworkspacedata . Now your contents.xcworkspacedata and project folder look like this after adding.

6. follow same steps above for adding multiple projects into xcodeproject as explained above.

Enjoy your coding. I hope you learnt something from this blog. Please hit the clap button below 👏 to help others find it!. follow me on Medium.

--

--

iOS Developer in walmart

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store