Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to convert dynamic framework to static library in Xcode?

Tags:

xcode

ios

Is it possible to convert dynamic framework to static library?

The problem is that I don't have a source code of framework, but only SomeFramework.framework file which is dynamic library for few architectures

like image 375
Vitalii Gozhenko Avatar asked Feb 14 '18 13:02

Vitalii Gozhenko


People also ask

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 difference between static and dynamic framework in Swift?

Static and Dynamic Frameworks:Static frameworks contain a static library packaged with its resources. Dynamic frameworks contain the static/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.

Is XCFramework dynamic or static?

An XCFramework can be either static or dynamic and can include headers.

What is difference between framework and XCFramework?

Whereas Universal Frameworks contain many slices without knowledge of the platform SDK for each one, XCFrameworks contain many slices organized by platform. Because of this platform-awareness, an XCFramework can target more than one platform for the same architecture, which solves our problem.


1 Answers

Create a "Cocoa Touch Framework" and add your .framework to the "Linked frameworks and Libraries" then you can:

  • Go to Build Settings > Match-O Type > choose what you want...

or

  • you can also add a "static library" as new target of your dynamic framework.

Don't forget to add the modulemap / Umbrella to expose what you want.

like image 175
Mohamed TAIEB Avatar answered Sep 30 '22 18:09

Mohamed TAIEB