title: How to build an iOS framework with weak-linked CocoaPods libraries
body: <p>I am trying to build an iOS Framework (Test.framework) using the new template offered by Xcode 6 for creating Cocoa Touch Frameworks.
  The framework has different dependencies (as AFNetworking or FacebookSDK) specified in a Podfile. I don't want dependencies to be included in the framework, I just want to link against them.</p>
  <p>The problem is that when I build the framework, the libPods.a is linked and included.
  <strong>Q: How can I link against libPods.a library, but not include it in the framework?</strong></p>
  <hr />
  <p><strong>More details:</strong></p>
  <p>I have read about weak linking:
  <a href="https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html" rel="nofollow noreferrer">https://developer.apple.com/library/ios/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html</a>
  But I don't have much experience playing with the project settings, I'm not a PRO.</p>
  <p>I tried marking libPods.a as an &quot;Optional&quot; but nothing changed, dependencies were still included.</p>
  <p>I tried removing the libPods.a from the section &quot;Link Binary With Libraries&quot; in Build Phases, but I got this error (after cleaning project folder and building again):</p>
  <pre><code>ld: library not found for -lPods-MyFramework-AFNetworking
  </code></pre>
  <p>I tried removing all the flags from &quot;Other Linker Flags&quot;, but it gives me undefined symbols:</p>
  <pre><code>Undefined symbols for architecture armv7:
    &quot;_OBJC_CLASS_$_FBSession&quot;, referenced from:
        objc-class-ref in TestClass.o
  ld: symbol(s) not found for architecture armv7
  </code></pre>
  <p>Here is the source code for a clean project with libraries included:
  <a href="https://www.dropbox.com/sh/0ymuzw6kiagz02j/AABzyHiZVaQQvBEnjBgRBq3ua?dl=0" rel="nofollow noreferrer">https://www.dropbox.com/sh/0ymuzw6kiagz02j/AABzyHiZVaQQvBEnjBgRBq3ua?dl=0</a></p>