Creating Framework Project - Cocoatouch Framework - ios

We are going to create a Cocoatouch framework, which has dependency of other 3rd party libraries (For Example : Alamofire , Reachability). What is the best way to create my own Cocoatouch frame work which internally using other 3rd party libraries. The framework which we are creating is a Dynamic framework and using swift language.
Please suggest which of the following is better approach.
Linking other frameworks (Alamofire) , inside my framework
Using cocoapods in my cocoatouch framework to link other third party libraries
Please provide any suggestions.
I'm new to this framework development. Usually what's the best way to create cocoatouch frameworks that depend on other libraries.

Related

How Objective-C Runtime detect framework is exist

I'm making a framework that use several third party framework, and those third party framework were install by developer who use my framework using cocoapods, I got some problem and I can not find any solution.
I was try __has_include to detect framework is exist, that just work at compiler time not work at runtime.
The problem like below:
How detect framework exist at runtime.
I need import framework if the framework exist.
I need to implement the third party protocol if the framework exist.

Create Umbrella framework using Carthage or CocoaPods

I have created Umbrella framework by adding sub-framework manually.
I wanted to know how to manage dependency of this sub-frameworks using Carthage or Cocoapods.
I know that creating Umbrella framework is highly discouraged by Apple.
I also wanted to make that third party framework installation optional for the application developer to know him all the dependencies inside the framework and make the framework size minimum.
Please suggest me what will be the best way to manage sub-framework dependencies (Carthage or Cocoapods)?
Thanks in Advance.

How to use third part framework inside my framework? (Swift / iOS)

I am trying to build a Cocoa Touch Framework written in Swift language.
There are cases where we need to use third party frameworks.
What I'd like to do is package an iOS framework (could be a Swift-framework, could be an Objective-C framework) inside another iOS framework (a Swift-framework) to hide the 3rd-party software dependencies and also hide the 3rd-party APIs.
Could anyone help with a step by step? I am using Xcode 9.2.

Cocoa touch framework embed other libraries

They asked me to create a cocoatouch framework that bundles all off our 3th party frameworks. So that we can use that framework all over the company.
Now I think it's better when you make the application responsible for adding the dependencies that your framework need but this not possible here.
So I created a framework added some frameworks like PureLayout.framework, etc.. and added them to the linked frameworks and libraries.
It compiles and delivers a .framework but when I add that framework to the project and run it, then I get this error:
dyld: Library not loaded
Reason: image not found
So I think they are only linked against and not embedded in the framework.
How can I really embed them?

Using code from framework without linking it

I am building a cocoa touch framework and including in my code third party framework - "framework_X"
How can i use it in a way that "framework_X" will not be linked directly to my framework, instead it will require the consumer project which use my framework to link "framework_X" to his project in order for it to work.
In Android this is done easily, but in Xcode if i am not linking the "framework_X" in my framework the project won't build
You can load libraries at runtime. Here an example of loading zlib with dlopen():
https://github.com/nicklockwood/GZIP/blob/master/GZIP/GZIP.m

Resources