Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Selectively use_framework! in cocoapods

Tags:

ios

cocoapods

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!

like image 218
Ben Lu Avatar asked Aug 03 '15 23:08

Ben Lu


People also ask

What is Use_frameworks in POD file?

use_frameworks! in the Podfile means that we want the listed frameworks to be dynamically installed instead as static frameworks.

Are CocoaPods static or dynamic?

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.

What is dynamic framework iOS?

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.

What is static framework?

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!


1 Answers

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.

like image 53
Keith Smiley Avatar answered Oct 12 '22 11:10

Keith Smiley