Cocoapods declaring multiple dependecies in the spec file

Viewed 5816

Till now I always only had one dependency to declare in a .podspec file.

My question is:

What is the correct way to include more than one?

When I include only one I do it like this:

s.dependency = 'ReactiveCocoa'

How do I include more than one?

1 Answers

You can have multiple calls to dependency in your podspec file, for example in RestKit.podspec:

s.subspec 'Core' do |cs|
    cs.source_files =  'Code/*.h', 'Vendor/LibComponentLogging/Core', 'Vendor/LibComponentLogging/NSLog'
    cs.header_dir   =  'RestKit'

    cs.dependency 'RestKit/ObjectMapping'
    cs.dependency 'RestKit/Network'
    cs.dependency 'RestKit/CoreData'
end
Related