How to use #import <> on a git submodule
I am including two libraries in my project. Since my project is a static library I decided to include the libs via git submodules rather than cocoa pods.
LibraryA has a dependency on LibraryB and imports it via
#import <>, which gives me a file not found error.
- Xcode 7 Git can’t find remote repositories
- Install or not Git on Mac OS
- Xcode source control - git add
- Keeping Pro and Lite Version on Different Branches
- Apple CI / Xcode Service and Jenkins
- How to merge conflicts (file project.pbxproj) in Xcode use svn?
/path/to/folder/with/my/submodules in both the framework and header search paths of my target, but the only way I’ve been able to resolve the error is by changing LibraryA to use
Is there a proper way to fix this that does not involve forking LibraryA and changing the import statement myself?
One Solution collect form web for “How to use #import <> on a git submodule”
If your app name is MyApp and your submodule is MySubmodule then go in the build settings for the app target and put this for the “Header Search Paths”:
Hopefully inside your submodule you have another dir that matches the MySubmodule name but here I’ll just say it is SDKName:
What happens is it now searches the root of the MySubmodule path and since the SDKName is a subfolder now you can use the <> syntax.