iOS Dynamic vs. Static Library / Framework
Find me on Github, Facebook, Youtube, etc by #iOSBySheldon.
Library and Framework are not same but close. Frameworks are just libraries with linking (binding). In other words, frameworks are just libraries that are bundled into targets. Therefore, their file extensions are different.
- Static Library - xxxx.a
- Dynamic Library - xxxx.dylib
- Framework - xxxx.framework
- A framework is a hierarchical directory that encapsulates shared resources.
- A framework is also a bundle and its contents can be accessed using Core Foundation Bundle Services or the Cocoa NSBundle class.
Dynamic framework works at runtime, a single copy of the library’s code is shared among all the processes using it, thus reducing memory usage and improving system performance. Through dynamic binding, frameworks can be updated transparently without requiring applications to relink to them.
The purpose of an umbrella framework is to provide all the necessary interfaces for programming in a particular application environment. Umbrella frameworks hide the complex cross-dependencies among the many different pieces of system software. Thus you do not need to know what set of frameworks and libraries you must import to accomplish a particular task. Umbrella frameworks also make faster builds possible through the use of precompiled headers. Example, UIKit is an Umbrella Framework including sub-frameworks like CoreAnimation, Quartz, etc..
Interesting Note: Swift won't allow static libraries that include Swift code