Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The solution I've adopted for this situation is as follows:</p> <p>I set up the Podfile quite simply:</p> <pre><code>workspace 'MyApp.xcworkspace' platform :ios, '5.0' xcodeproj 'Common.xcodeproj' pod 'AFNetworking', '1.1.0' pod 'TTTAttributedLabel', '1.6.0' pod 'JSONKit', '1.5pre' pod 'Reachability', '3.1.0' target 'MyApp' do xcodeproj 'MyApp.xcodeproj' # specific dependencies end </code></pre> <p>This way the Common lib and MyApp are set up correctly to use all the dependencies. However, this will still cause duplicate symbols. The way to get around that is to simply delete libPods.a from the Common project's Build Phase. This is fine because we don't really want to link to the Cocoapods static lib to our static lib anyway. All the correct dependencies will be linked when you build the app, and all the correct header paths are set up in the .xccconfig files so Xcode/AppCode will still provide all your auto-completions and everything will compile.</p> <p>You'll need to delete the libPods.a each time you run <code>pod install</code> which is a bit of a pain, but it might be better suffering that than managing all the dependencies manually.</p> <p><strong>Update:</strong> I'm working on this as I write and I've just noticed it's important not to use the Linker Flags Cocoapods sets up within your static library. By default, my static lib had overridden their value with no value but Cocoapods warns against this and advises you use $(inherited). Just ignore it.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload