Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Cocoapod dependency trees

After wresting the traditional git submodule + static library dependency chain, it became a giant headache. I tried to get it all to work for a long time. You must:

  1. Create a workspace and drag your child projects in.
  2. Add their targets as binary linked libraries.
  3. Manually add header search paths.
  4. And all your dependency projects must be set up a certain way for this to work too. So that's a lot of work.

A much better way is to use submodules to include the child projects into the parent project and then use cocoapods to include those child projects (instead of linking them in statically and dealing with the millions of headaches that brings).

For example, I've added my dependency tree as a series of git submodules and then I have a Podfile that looks like this:

platform :ios, '6.0'

# local (submodules)
pod 'FirehoseCocoa',                path: "FirehoseCocoa"
pod 'MTAnimation',                  path: "MTAnimation"
pod 'MTDates',                      path: "FirehoseCocoa/MTDates"
pod 'MTPocket',                     path: "FirehoseCocoa/MTPocket"
pod 'Base64',                       path: "FirehoseCocoa/MTPocket/Base64"
pod 'XMLDictionary',                path: "FirehoseCocoa/MTPocket/XMLDictionary"
pod 'MTJSONUtils',                  path: "FirehoseCocoa/MTPocket/MTJSONUtils"

# ours
pod 'MTQueue',                      :head
pod 'MTGeometry',                   :head
pod 'MTStringAttributes',           :head

# third-party (customized)
pod 'BlocksKit',                    git: ""
pod 'REMenu',                       git: ""
pod 'GetGravatar',                  git: ""

# third-party
pod 'JASidePanels',                 '~> 1.3.1'
pod 'SVProgressHUD',                :head
pod 'SVPullToRefresh',              '~> 0.4.1'
pod 'TestFlightSDK',                '~> 1.3.0-beta.5'
pod 'FrameAccessor',                '~> 1.1.0'
pod 'GCNetworkReachability',        '~> 1.3.0'
pod 'GVUserDefaults',               '~> 0.9.0'
pod 'SORelativeDateTransformer',    '~> 1.1.5'
pod 'libPusher',                    '~> 1.4'
pod 'GCPlaceholderTextView',        '~> 1.0.1'
pod 'KISSmetrics',                  '~> 1.0.0'

I suggest this route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment