title: Embedding frameworks inside closed-source Swift framework
body: <p>Our company wants to distribute a closed-source SDK for iOS to our clients. I've been using Cocoapods to build the framework and built an example app making use of it. Previously the app worked fine on the simulator as well as when deployed on the device. However, I was also embedding the Pods.framework file in the app itself. One other piece of information that may be of interest is that the framework is written in Swift, the included cocoapods dependencies are both Swift and Objective-C.</p>
  
  <p>I wanted to make the pods requirements easier to manage so the user doesn't need to be concerned with them and tried to embed the Pods.framework file inside of the SDK we're building - so I removed the steps to <strong>Embed Pods Frameworks</strong> and <strong>Copy Pods Resources</strong> from the example app, leaving them only in the framework, I also removed Pods.framework as a dependency of the example app, leaving it only in the SDK. This seemed to work in the simulator, but the app now crashes on mobile device with <strong>dyld: Library not loaded</strong> error.</p>
  
  <p>Upon researching it, I stumbled into a few related discussions:
  <a href="https://github.com/CocoaPods/CocoaPods/issues/344" rel="noreferrer">https://github.com/CocoaPods/CocoaPods/issues/344</a> <a href="https://objectpartners.com/2014/06/25/developing-private-in-house-libraries-with-cocoapods/" rel="noreferrer">https://objectpartners.com/2014/06/25/developing-private-in-house-libraries-with-cocoapods/</a></p>
  
  <p>However, the suggested solution of using private pods does not look like it would work for us, it's my understanding that the source code in the private pod would still be open, and we can't share it with our clients.</p>
  
  <p>Could someone advise on a solution that would work in this case?</p>