I am in this situation ... I am starting a new SDK that I want to release through CocoaPods, the SDK itself needs some Pods ( AFNetworking
). I wonder which one is the best way to set up the project, given that I need to try the SDK in an example project in time of writing.
My first attempt began with the pod lib create
command. I followed all the instructions and I got a complete workspace, wonderful! Now how to enable AFNetworking
? I have to add it as a dependency in mySDK.podspec
file using: s.dependency 'AFNetworking', '~> 3.0'
so that users of my SDK can also include it in the library, fine. But how can I include it in my current project to use it during development?
I see that in the Example folder created by cocoapods, I have a Podfile
, but it contains only an example and a test target ... I tried to include the SDK target here, but it does not seem to work like that.
source 'https://github.com/CocoaPods/Specs.git' use_frameworks! target 'MYSDK_Example', :exclusive => true do pod 'MYSDK', :path => '../' end target 'MYSDK_Tests', :exclusive => true do pod 'MYSDK', :path => '../' pod 'Specta' pod 'Expecta' end
I tried to enable the following configuration and run pod install again ...
target 'MYSDK', :exclusive => true do pod 'AFNetworking', '~> 3.0' end
I get a general terrible mistake, and in any case, this is not very good as a solution.
This is the structure created by the lib create command , where I have to add a new Podfile to include the library that I need to develop the library.
MyLib ├── _Pods.xcproject ├── Example │ ├── MyLib │ ├── MyLib.xcodeproj │ ├── MyLib.xcworkspace │ ├── Podfile <----- the Podfile previously described │ ├── Podfile.lock │ ├── Pods │ └── Tests ├── MyLib.podspec ├── Pod │ ├── Assets │ └── Classes │ └── TheFilesForMyLib.[swift/m] <---- My Lib code