Integrate Alamofire into a Cocoapods library


I'm doing a component in github integrated with cocoapods, the thing is that I want to use Alamofire within the component and of course I have not seen anywhere like making use of a library like Alamofire inside another library that would be the component what am I creating? Any ideas? I tried to add the files manually but without luck.

asked by Alejandro 04.08.2016 в 17:36

1 answer


What you have to do is not integrate the Alamofire in your library, but in the specifications of Pod indicate that Alamofire is a dependency. This way, when your library is installed, so will Alamofire

On the website of Cocoapods you will find how to add dependencies

One of the examples on the web is this do |spec|         = 'libPusher'
  spec.version      = '1.3'
  spec.license      = 'MIT'
  spec.summary      = 'An Objective-C client for the service'
  spec.homepage     = ''       = 'Luke Redpath'
  spec.source       = { :git => 'git://', :tag => 'v1.3' }
  spec.source_files = 'Library/*'
  spec.requires_arc = true
  spec.dependency 'SocketRocket'

If you notice, the last line indicates a dependency to SocketRocket which will cause it to be installed next to the library of the example.

answered by 04.08.2016 / 23:43