IOS : 3rd party dynamic framework inside a static library - ios

Is it possible to embed a dynamic framework inside a static library in such way that when using the .a lib in other projects, there is no need to use link framework/embed binaires.
So using the framework inside the static library just by using the header name.
If so, how is it done?
THANKS.

Related

Custom Framework Always include in Embedded?

Custom Framework Always include in Embedded Section is there another way instead?
You must embed dynamic frameworks, because they are based on a shared library, and shared libraries are loaded at runtime. You could create a static framework wich contains a static library. Static libs are linked at build time, and thus they must not embedded into your app.

Include public headers of static library in a dynamic framework

I'm developing a dynamic framework for iOS. This framework uses a static library, which is integrated with CocoaPods:
+--MyDynamicFramework
+--PublicHeader1.h
+--PublicHeader2.h
+--Sources
+--Pods
+--StaticLib
+--PublicHeader3.h
+--StaticLib.a
Now, I'm using PublicHeader3.h (which is part of StaticLib) in the sources of my dynamic framework, but I'd also like to expose it as a public header of the dynamic framework I'm building. So an App that uses my dynamic framework should be able to see all three public headers. Is this possible, and if yes, how?
Build Settings -> Header Search Path -> Add PATH of MyDynamicFramework/Pods/StaticLib

is there need of static library to create framework?

Is this necessary to create static library for creation of framework or we can create it without help of static library what is diffrence betwwen them.
You have two options for creating framework, one is static library (code is linked at compile time) and iOS8 onwards dynamic framework(code is linked at runtime). Refer to following answers for knowing the difference between them :
Library? Static? Dynamic? Or Framework? Project inside another project

Can I use a third party framework and static libraries inside my project to create my static library so have just .a file and headers at the end?

I generally don't create static libraries so can you please help me on this;
I have a third party framework and 2 static libraries inside my project so that I will build my own static library by using them. So is it supported to put static libraries and third party frameworks into my project so that I can create my own library? I see that some of the sources say this is not supported while some say it is ok. Please let me know.
Thanks,
E.
technically you would export the third party framework and insert it into your library. When it comes to the static libraries, its possible from that point since your just calling one library from another.

How to create static library from an existing framework in iOS?

I have been provided with a framework by a third party vendor for an iPhone hardware accessory. So I have a folder like Device.framework. Inside that folder is a binary file and a set of .h files. There are instructions for how to add this to an iOS project and use the classes contained within. However, I'm actually using MonoTouch and want to use a static library.
Is there a way to create a static library that makes all the classes from the framework available in the static library? So in my MonoTouch project I would link in the static library and have access to that framework.
A *.framework is simply a package containing: the static library, headers, associated meta data. Copy and paste the .framework and extract the static *.a file and related header files.
Then it's simply a matter of using the MonoTouch btouch tool to bind the static library for use in your MonoTouch project. There is a great example of how to bind a native library to MonoTouch on Github. With guidance on targeting simulator + device and using the LinkWith attribute to embed the static library in a single *.dll:
https://github.com/xamarin/monotouch-samples/tree/master/BindingSample
Also, make sure to check out the btouch Reference documentation here:
http://docs.xamarin.com/ios/advanced_topics/binding_objective-c_types
Rename that binary file to Device.a. You can do that as the framework you mention is not done by Apple, hence it has to be a static library and not a dynamic one.
Make sure your project links that library (Device.a).
Include the headers in your project and reference them where appropriate.

Resources