Search code examples
xcodeworkspace

When to use workspaces in Xcode? Why not just add the xcodeproj file to existing project?


I don't fully understand when to use a workspace.

Here is what I have been doing so far --> Whenever I need to use a static library of another project, I drag the .xcodeproj file from finder to the Xcode navigator of my new project, link the libraries, add the user paths, and start working. I also add the appropriate target dependencies.

Why is using a workspace better? Should I be using a workspace? I have tried understanding apple's documentation, but I seem to be getting whatever I need without explicitly creating a workspace.


Solution

  • Here's what I found so far, it makes using static libraries easier. If you add the path to the static libraries xcodeproj file in your source tree, and specify the path in the build settings user header paths, and set Always search header paths to "YES". Then you're set. All you need to do is link to the static library in your build phase. Code completion works.