podspec with dependency to another ios framework project

点点圈 提交于 2019-12-11 07:59:50

问题


I had developed a swift farmework to share with other developers(Lets name it B). This framework is using another ios framework project that I created recently with objective-c (lets name it A).

Now, I want to share framework B with cocoa pod. I wondering how should I link these two project in the podspec file. Does I need to share both of them with pod? or is there any other solution that just share project B?


回答1:


I was having same question when I was trying to create a swift framework that is using obj-c framework, but didn't find an excellent solution.

So I've made a dependency in podspec file and now my swift framework can be installed by a podfile and it works fine. When I call pod install/update it installs/updates my framework and a dependency framework

The dependency can be created by one line

spec.dependency 'SomeOtherPod'

Check this link https://guides.cocoapods.org/syntax/podspec.html

Also you can check my podspec

The only thing that I don't like is that I have one warning in my project now:

Multiple build commands for output file ..../Build/Products/Debug-iphonesimulator/NMSSH/NMSSH.framework/Headers/NMSSH.h

Still trying to find how to solve it

Hope this will help you




回答2:


You have 2 options: 1. Distribute both pods and use spec.dependency in your podspec file (see Woof's answer) 2. Add A source files directly to B's source files



来源:https://stackoverflow.com/questions/44047240/podspec-with-dependency-to-another-ios-framework-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!