How do I build a framework and be able to use it within the same project

I am building a framework and an app, the framework is a dependent on the app so that works..

But within the app I can't use

#import <OpenGL_4_6/OpenGL_4_6.h>

But I have to use

#import "OpenGL_4_6/OpenGL_4_6.h"

I can see the framework being built its in a directory that I can't seem to express with the $ macros for Xcode

Library/Developer/Xcode/DerivedData/MGL-bpbwpidwnbulrxgcndprcdmfrosb/Build/Products/Debug

I tried to set my framework search path to this.. but to no avail.

Thanks for the post, love you selected emoji! This a great post for developers to provide their opinion on how they will handle that situation.

In my modest opinion I would make sure the framework is build for external use and reference in the project as an external framework, if the code is part of the project, you can just include the file you want instead of using it as a framework. Otherwise just build the framework and use it as you would be using an external framework. Ensure that the framework search path includes the directory containing your framework bundle. You typically want to point to the or directory inside . Alternatively, use which automatically points to the correct build directory depending on the scheme (Debug/Release).

If your framework is custom and part of the same project, ensure it's added to the "Link Binary With Libraries" phase of your app target. Consider copying the framework into the app bundle if needed by setting up a Copy Files build phase.

If your framework and app are in separate projects, consider using an Xcode workspace to manage both. This can simplify dependencies and path settings.

Hope this helps, looking forward to other people’s recommendations

Albert Pascual
  Worldwide Developer Relations.

How do I build a framework and be able to use it within the same project
 
 
Q