I wish I can compile some pods into dynamic frameworks while keeping others as static frameworks.
use_frameworks!
pod 'A'
pod 'B'
pod 'C'
By default the use_frameworks!
option is an all or none approach. I wonder if we can opt out some of the frameworks from being compiled dynamically.
For example, how can I make pod A
compiled into dynamic framework while keeping B
and C
static libraries? Thanks!
use_frameworks! in the Podfile means that we want the listed frameworks to be dynamically installed instead as static frameworks.
CocoaPods pod-linkage plugin In SwiftKey, we have a dynamic framework that we use to share code between the app and the keyboard extension, and all the pods are linked statically except for some of them that are linked dynamically because they are linked to the app and keyboard extension too.
A dynamic framework is a bundle of code loaded into an executable at runtime, instead of at compile time. Examples in iOS include UIKit and the Foundation frameworks. Frameworks such as these contain a dynamic library and optionally assets, such as images.
Static frameworks contain a static library packaged with its resources. Dynamic frameworks contain the dynamic library with its resources. In addition to that, dynamic frameworks may conveniently include different versions of the same dynamic library in the same framework!
This is not possible with CocoaPods. One option would be to include your static libraries manually, and include your other dependencies as frameworks through CocoaPods. Although this is not ideal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With