In Xcode, create framework as target in same project as app vs separate project for framework

78 views Asked by At

Main question

Here is my scenario: I have app A in Xcode project X. I will create framework F to use in app A. I could create framework F inside project X as another target. I could also create a new project Y to hold framework F.

What are the differences (capabilities, features) between those 2 choices?

The only thing I can think of is that separate Xcode projects make sharing of the framework source code easier. Everything else that I can think of is minor. The flexibility of schemes and targets in a single project eliminates most other differences that I can think of.

Examples of minor differences if choosing separate project:

  • a shorter list of targets
  • target does not inherit build settings from app project
  • framework will show up as blue icon in Project Navigator instead of gray folder icon

Meta points

No one seems to have written about this exact topic. Hence, why I am posting this question.

Duplicate question?

I wish this question was a duplicate but all other related questions that I have surveyed are about:

  • what frameworks are and how to create them
  • what targets are and how to create them
  • what Xcode workspaces and projects are and how to use them
  • how to extract app code into a separate framework

I am not asking any of these things.

Reason for xcode14 tag

So many questions and articles and docs are for ancient version of Xcode (like 4) and with the last two version of Xcode (14 & 15), the build system has been updated significantly. Answers to my question could be quite different for older versions of Xcode.

0

There are 0 answers