2

This link discusses how to create iOS static framework, and they said

With static libraries, everything else (including the header files) you must distribute separately.

Actually I found no difference between using static lib and framework, you can look at the Admob SDK (https://developers.google.com/mobile-ads-sdk/docs/), what they ask is just pull all the files in the XCode project, so I really don't understand why we need to use framework over just plain static lib, or am I missing something?

7
  • You should need the .a file plus the .h files, and also any sound or image files, etc. Commented Aug 20, 2012 at 16:32
  • a Framework usually combines the header files and .m files in one package, unlike a library which only has the source (.m) files, and you have to add the header files separately to your project. Commented Aug 20, 2012 at 16:37
  • You were not allowed to include a Framework in Xcode 3 - just libraries. At some Xcode 4 started to support them. Commented Aug 20, 2012 at 17:50
  • @DavidH that is wrong. Custom frameworks using dynamic libraries were always prohibited on iOS (non jailbroken). Custom frameworks using static libraries were always supported (by supported, I mean using them worked fine already on Xcode 3). Commented Aug 21, 2012 at 15:57
  • @Howard we do not "need" to use them, it is mostly a convenience thing. It is just much more convenient to add a framework compared to adding a library and a bunch of headers. Commented Aug 21, 2012 at 16:00

1 Answer 1

6

Basically a framework is a collection of static libraries (e.g. one for i386, one for ARM) and the header files. Furthermore a framework also is a special folder with a very well defined structure.

I am not quit sure what you mean by 'just add the folder in Xcode'... If you mean adding a folder containing all the source code or a folder containing the static library including the header files you are right and there (very often) is no really big difference (depending on the library to include).

Using a framework is primarily a usability thing. Adding a framework, which means adding one single artifact, is less error prone than adding a bunch of files. For example it is not possible to accidentally omit one header file.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.