-1

I have not seen this question asked, and answered for several years. We are now on much newer versions of Xcode and Pods so I think it is worth re-visiting.

If I want to create a cocoa touch framework that itself wants to be dependent on specific pods how does one go about this?

I want to add a few pods, like alamofire, to a cocoa touch framework I use in several other workspaces that also use their own pods.

I was about to add the pods to the frameworks and then realized all the issues that may come up and thought I would ask here first because I saw no real relevant information that was related to the latest Xcode and pod versions.

This is for iOS swift projects using Xcode 10.

Any inside from those who already do this is appreciated!

Thanks, B

bworby
  • 1,045
  • 1
  • 10
  • 17

1 Answers1

0

Firstly, adding a another library in your on cocoa touch framework results into a umbrella framework which is not recommended by Apple. You can check below:

Why are umbrella frameworks discouraged?

Answer to your question:

Create your cocoa touch framework (Say it as MyLib) which depends on other library (Say it ThirdPartyLib). In this scenario you have to explicitly mention to developers who will use MyLib they have to add ThirdPartyLib as well in their project.

If you upload your library on cocoapods there use can mention in podspec file with property:

s.ios.dependency 'ThirdPartyLib'

Doing above dependent library will install with your framework, when any developer try to install you MyLib pod.

Daljeet
  • 1,573
  • 2
  • 20
  • 40
  • Thanks for your answer. I get that idea, but there are many instances I can think of where you would want to use pods in an internal framework where you re-use a pre-built app that could depend on pods. Not one for release, but for internal usage. Especially when it relates to web services and specific objects. That beings said, I get what you're saying. Using the podspec process was something I had already thought of, but figured there were newer options I was not aware of. I have not read any docs on the newer versions of pods. Thanks again. – bworby Mar 01 '19 at 06:05