I'm working on a project where I created a SDK (cocoapods) with two dependencies - AFNetworking and Realm. Here is my process:
User who wants to use this SDK then 'installs' this cocoapod. When he does this AFNetworking and Realm are installed alongside (because they are dependencies)
What I would like to do is somehow embed AFNetworking and Realm inside a framework. I know that framework will be bigger in size. Main reason for doing this is so that user is not obligated to use the same version of AFNetworking and Realm.
The CocoaPods Packager is taking care of what you want here automatically.
- You can pull in third-party dependencies using CocoaPods. (CocoaPods Packager is even capable of mangling symbols to improve compatibility with any symbols that might appear in the integrating app.)
The packager builds open-source podspecs for you. This podspec needs to declare all sources, resources and dependencies. Please note that podspecs never lint nor build when not all of their dependencies are declared correctly.
But as the packager takes care of vendoring the dependencies by mangling their symbols, it allows you to create a big binary, where the dependencies were included from static libraries.
On base of that build product, you can have a modified version of your podspec. This should not declare the dependencies anymore when they are included and shouldn't need declare the source files or need to have them publicly available anywhere, but instead you declare the built binary as vendored library. This still needs to specify the header files and have them accessible, so that consumers of the podspec are able to interface the API of your library.
The CocoaPods Packager creates this variant of the podspec for you as well.