Can I add Pods in Custom framework? - ios

I have the custom created framework.
I want to use CryptoSwift Pods in this framework.
First, I create a custom framework and I can use this framework(From Frameworks folder Example.framework) from another project.
Second, I installed CryptySwift Pods to these frameworks
How can I install Pods programmatically in custom frameworks and used it in other projects?

Not understanding you exact question but if you want to create your own framework and you are using any third party then you can create your framework with your own files and then when you will use your framework in another project then ask developer to install those third party pods or frameworks into their project. It will help to avoid conflict if developer also using same framework or pod in their project.

Related

iOS CocoaPod that uses a separately distributed framework

My project involves creating a CocoaPod for public distribution that wraps functionality of a separate framework. The end-user project implements our wrapper and we deal with the complex system underneath. This means that our Pod references that separate framework but the end-user project does not.
I have had trouble working out how to automate the set up of the separate framework from within the podspec file. As it stands now, any time we run pod install we must add the framework to the Pod target for the methods to be correctly referenced. This may become a problem for other clients that use our Pod.
Is there a way to use the podspec settings to add a .framework file to the overall project?

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.

Framework target, App target and cocoaPods working together, how to maintain dependencies

I am creating a framework that uses third party frameworks like alamofire. I have created a App that uses this framework and also uses third party framework again like alamofire(both could use it). So now I have 2 targets, I added both in workspace, I did pod init but it could only link with only one .xcodeproj and create its own workspace.
I also tried
Can I use CocoaPods when creating a Cocoa Touch Framework?
but pod install didn't work as it was not able to find target and if dragged in same folder it ask to specify target path as it only want one .xcodeproj
Please if somebody could help me with this. How to access cocoa pods framework in both custom framework and app.
Ideally the Pod should be in your App.
Even though your Framework is also using the same third party framework the pod install should be done for that at App level and both App and framework should be able to read it.
Have said that, if you are developing Framework independently you can install POD at that time in framework but when your are using this framework in app then the third party framework can be installed at app level and frameworks should also be able to read it since they are now also part of same App target.

Cocoa Touch Framework Dependencies

I'm trying to create a Cocoa Touch Framework. To create a framework is not a problem, I used this tutorial and it is good.
I need to use third party libraries inside: like openssl, XLForm, AFNetworking. I know that it is not correct to include them in my framework, I need to create a dependencies, but I can't find how to do this.
Moreover is it possible to use pods in my framework and just make dependencies to these libs. So user which will include my framework to his project will need just install these pods.
It seems that I found solution.
Thanks to #Droppy and thanks to this question.
What I did: I just installed pods to my Framework project but used this use_frameworks! key.
Then I dragged my Framework to my Project and installed pods there, also with same key, otherwise (when pod wasn't installed in my Project) I was getting error like:
dyld: Library not loaded: #rpath/XLForm.framework/XLForm...
I used XLForm inside my Framework.

Combine Cocoapods and Carthage

I'm creating a Swift framework that is dependent on several other third party frameworks. Both these other frameworks support Carthage and Cocoapods.
Is there any way I can make my own framework support installing using both Carhage and Cocoapods? Or is just not achievable and should I just pick one?
You can definitely make your framework available with both CocoaPods and Carthage. This is the path that I would recommend to allow your users to use whatever solution they prefer. Also note that setting a framework up to work with Carthage also makes it much easier for users who want to use your library without either of these solutions.
On a high level, for CocoaPods you'll want to create a podspec that lists your dependencies there. This way CocoaPods will manage downloading and configuring them along with resolving them against other user dependencies. See more here.
For Carthage you'll want to configure your project with framework targets for the platforms you support and add your dependencies in your Cartfile. More on that here
Combining both is actually not difficult. With my framework I have started with CocoaPods template containing Example and Pod directories. In the example project I created a new Cocoa Touch Framework target, made sure this target is Shared (in Product - Schemes - Managed Schemes) and dragged content of my Pod/Classes directory to the project (with unchecked Copy items if needed and added Target Membership only to this newly created framework).
This should be enough, Carthage should find this shared scheme and use it. Just keep in mind you have to commit changes and create a new git tag before using your framework from Carthage.

Resources