问题
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