Using two Xcode projects with one target - ios

I have one app I am trying to build called "App". I have an Xcode project called App.xcodeproj that lives in a Xcode workspace called App.xcworkspace. That is all working.
This is what I want:
A second Xcode project (AppCore.xcodeproj) that I can separately build on iOS or Mac. However there is no need to actually run the project (app). It will be the data layer of my app.
I then need to be able to access the files inside AppCore.xcodeproj from App.xcodeproj.
Update:
In this project, I will be using CloudKit. The Core project is the only thing interacting with CloudKit, however the actually target (app) using CloudKit is the "main" project.
How can I accomplish this?

Here is the tutorial GIF:
Remarks:
You can add existing project as well, just drag it into you xCode project.

Related

Build Swift Package Library and an iOS project at the same time

I want to create an iOS project and Swift Library in the same workspace. Everything is working fine, the only problem is that I have to build the library first if I want to add something new.
Is there a way to build both at the same time or in order with a single button?

Xcode 9 : Archiving framework creating alias inside framework

Archiving framework through script creating an alias of the framework. I’m working on a project which has other custom frameworks. Main target has a scheme which is dependent on multiple frameworks. Attached image for better understanding.
Everything is running fine in debug mode, each framework is being built & created properly but when I try to archive project the archive process passes but frameworks itself contains alias/shortcuts.
For archiving I used script like -
I tried multiple ways to build, clean, delete derived data, changed Optimization Level etc.
What is the possible solution for the case?

Proper way to debug your own framework project from main app project in Xcode 8?

I have read about two possibilities for that:
To build the framework as debug, to add it to main app project, and run the main project also as debug. Breakpoints should allow you to inspect the frameworks code stepping into it.
To add somehow the framework project itself to the main app project
I tried first one and it is not working for me. I get an Couldn't Generate Swift Representation when trying to step into framework's code. If this option should still work in Xcode 8 and Xcode 8.1, what settings should I check?
If the best/only option now is the second one, how should I properly set that?

Xcode 7 is using my framework after I deleted it

I'm in the process of developing a framework. My problem is that the changes I make to my framework are not being reflected in my app. My app seems to be linked to the original framework I created and isn't updating when I update the framework. Even when I delete the framework from my project, xcode still seems to think it's there.
Setup
I created a separate xcode project intending to make an app that uses the framework. I copied the root folder of my framework project into my app project root folder and I drag and dropped the .xcodeproj into my App's xcode project. I added the framework from my nested xcode project in each of the following steps:
Build Phases>Link Binary With Libraries
Build phases>Target Dependencies
General>Embedded Binaries
I tried removing the framework from each of these locations.
I tried cleaning the framework project and App project.
I tried deleting the derived data in my app project and framework project in Window>Projects
I tried using a previous version of my app project that doesn't contain the framework in any way (not in the xcode project or root folder)
The ghost of my framework continues to haunt my project! Any help?
I suppose you must have tried deleting it from build phases as well... just in case though:
Go to Build phases -> Link Binary with libraries
Select the one you want to remove, press minus button down there.
Do it for all modules: as in Debug, Release.
You can also try deleting the older framework and emptying trash to be on the safer side.
I just made a mistake.
I was using the classes I built my framework out of rather than the framework itself. I thought deleting these classes and selecting 'Remove Reference' would stop Xcode from using them. I deleted these classes completely and Xcode told me they couldn't find the class I was looking for-- indicating it was using those files rather than the framework.
Also, in my AppDelegate I used
import "ExternalClass.h"
Which I believe is for classes that are in the project. I changed this to
import <ExternalClass/ExternalClass.h>
to import the header file from the framework instead.

How to create a Xcode 6 workspace that includes 2 iOS Projects and an iOS Dynamic Framework project?

I'm trying to create one Xcode workspace that includes 3 projects:
- 2 different iOS apps
- One dynamic framework project
The two iOS apps should use the framework.
Sounds very easy and reasonable thing to do, but I just can't seem to make it to work.
When I add the framework to the iOS app target as linked library, the build process works but when running I get an exception that the framework could not be found.
If I go to the Embed Binaries -> click add -> choose the framework from the framework project, nothing happens (the embed binaries section stays empty.
I tried to do first add the framework as linked library, then add it to the embed binaries. Now compilation doesn't work (can't find the framework).
What am I missing? Every single example in the documentation shows how to add a framework as a new target under the same project. But that's doesn't help. I want the framework to be a separate project that a team can work on separately.
Open Xcode, so you can see Xcode in the menu bar.
Then go File>New>Workspace.
I believe you just drag and drop other projects into the workspace.
I've never really used a workspace, although I have made one before.

Resources