Embed Framework vs. Link to Framework

I have a workspace with my main project. I have some other projects that create static libraries. Converting them to frameworks.


Question:


If I "Link to a Framework" do I have to "Embed Framework?" This is my own framework, which I have the source code to. Do I have to specficially embed the binary, or is that handled?

The embed framework doesn't seem to work in my case. Is this only for thrid party applications?


Question 2:


If I make my framework headers "public," but only use the framework in my own applications, are the headers private and encrypted or are they public? Seems obvious, but I feel like I should double check.

Thanks

You'll need to link the framework in the Application's target Build Phases, Link Binary with Libraries.


Then you also need to ship the private Framework inside the Application. To do that, use the Application's target Build Phases, Embed App Extensions. Ensure the Destination drop-down is set to Frameworks.


Your Framework headers should be set to Public in order for them to be used by the Application. You'll need to ensure you have a umbrella/master header named the same as the Framework, that includes all of the headers in it so that the Application can use that module.

In your Application, you can @import MyFramework; rather than using a precompiled header or #import <MyFramework/MyFramework.h>.


The copy framework action (PBXCp) copies the framework into the Frameworks/ directory of the application binary and uses a few extra parameters to strip out public headers, documentation, modules, swift modules etc, so none of that will be shipped to the end user.

Embed Framework vs. Link to Framework
 
 
Q