Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Frameworks, embed another framework or library?

So in Xcode 6, we finally have the possibility to create and distribute our own libraries as Frameworks (as opposed to Static Libraries before).

The question, is it possible to "embed" another framework or library directly inside the framework rather than ask the end user to link them?

The reason is as follow: Creating and distributing frameworks for other people often requires them to manually add whichever framework we link against. That's fine when these libraries are a default ones that can be added straight from Xcode, but when we need to link against other public frameworks. One example would be if the framework uses AWS as a backend, it's a bit overkill to ask developers to also download a specific version of their SDK and link against specific bits that are required. And it becomes more overkill when we need others for performance logging or more.

On OSX, there is the possibility to use Umbrella Frameworks, but it's undocumented on iOS.

Thank you.

like image 849
Einho Avatar asked May 15 '15 09:05

Einho


1 Answers

Recently done this myself on iOS, unfortunately any framework that has sub-frameworks must also be linked to in the project the parent framework gets used in.

Create the framework as per normal, and include the other frameworks under that framework (it should be an aggregate target).

Then build the parent framework, and link this into the main project. Attempt to compile and it will mention that it needs it sub-frameworks also linked. You can then link these sub-frameworks in addition and it will compile.

This is unfortunately a limitation of Xcode/iOS as it currently stands.

like image 59
Joshua Finch Avatar answered Oct 12 '22 08:10

Joshua Finch