2

enter image description here

I have an app project 'Test' and a cocoa touch framework 'TestFramework' as shown on the above image. How can I use Cocoapods to declare dependency for my TestFramework, and when I embedded the 'TestFramework' into my 'Test' project, my 'Test' will be able to use the depedency in my 'TestFramework'

For example:

'TestFramework' dependency: AFNetworking

'Test' dependency: MBProgressHUD

After 'Test' embedded 'TestFramework', the dependency of 'Test': MBProgressHUD AFNetworking

In maven, I am able to declare dependency for modules in its own pom.xml, and I can set the module A to depend on module B dependency by using How can I achieve this with cocoapods

1 Answer 1

3

You have to create a podspec file for your framework (follow these guides https://guides.cocoapods.org/making/index.html), including the dependency:

Pod::Spec.new do |s| ... s.dependency 'AFNetworking' end 

And then import your framework form your app's Podfile:

pod 'MyFramework' 

This should solve transitive dependencies without problem

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.