Integrate Alamofire into a Cocoapods library

2

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
source

1 answer

1

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

Pod::Spec.new do |spec|
  spec.name         = 'libPusher'
  spec.version      = '1.3'
  spec.license      = 'MIT'
  spec.summary      = 'An Objective-C client for the Pusher.com service'
  spec.homepage     = 'https://github.com/lukeredpath/libPusher'
  spec.author       = 'Luke Redpath'
  spec.source       = { :git => 'git://github.com/lukeredpath/libPusher.git', :tag => 'v1.3' }
  spec.source_files = 'Library/*'
  spec.requires_arc = true
  spec.dependency 'SocketRocket'
end

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
source