Adding a subproject makes it easier to make changes to your subproject, and then see those changes instantly reflected in the parent project. To add a subproject, you subproject must first be a static library (unless it’s an app extension).
But once you’ve got a static library subproject, here’s how you add it.
Drag the subproject in via finder
Then select the Main project -> MainApp Target -> Build Phases -> Target Dependency
Then add the Link Binary with Libraries
If you have setup your staticlibrary like I explained here you now need to tell the main project where it can find the public header.
Under Build Settings search for User Header Search Paths and add $(CONFIGURATION_BUILD_DIR) (non-recursive)
With that done, you should now be able to import the static library header and use it in your main app.
Links that help
https://www.cocoanetics.com/2011/12/sub-projects-in-xcode/
https://www.cocoanetics.com/2012/01/helping-xcode-find-library-headers/
Dec 23, 2016 @ 16:06:11
Feb 23, 2017 @ 21:24:32
Dec 28, 2017 @ 15:51:06
Hi, I followed this tutorial, but I’m getting an error when importing the StaticLibrary.h. Please suggest me an alternative to achieve it. Thanks In advance.