Created
October 12, 2018 14:29
-
-
Save olgusirman/ddb51a4dbb06cba02f70c93a953c4202 to your computer and use it in GitHub Desktop.
Static & Dynamic libraries.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Static & Dynamic libraries | |
https://www.ca.com/en/blog-developers/dynamic-versus-static-framework-in-ios.html | |
https://stackoverflow.com/a/15331319/3215761 | |
Static library - a unit of code linked at compile time, which does not change. | |
However, iOS static libraries are not allowed to contain images/assets (only code). You can get around this challenge by using a media bundle though. | |
A better, more formal definition can be found on Wikipedia here. | |
Dynamic library - a unit of code and/or assets linked at runtime that may change. | |
However, only Apple is allowed to create dynamic libraries for iOS . You're not allowed to create these, as this will get your app rejected. (See this other SO post for confirmation and reasoning on such). | |
Software Framework - a compiled set of code that accomplishes a task... hence, you can actually have a static framework or a dynamic framework, which are typically just the compiled versions of the above. | |
iOS Dynamic vs. Static Library / Framework | |
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. | |
* Umbrella Framework: | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment