title: Conditional framework linking (SDWebImage vs WebImage)
body: <p>I have a custom framework which references the "SDWebImage". The problem is the different module/framework names which are used by SDWebImage, as stated on the README already:
  <a href="https://github.com/rs/SDWebImage#usage" rel="nofollow">https://github.com/rs/SDWebImage#usage</a></p>
  
  <p>Since I switched to embedding Swift Code, I got rid of Cocoapods, because it caused too much issues for me, switching to Carthage. Everything worked fine so far, but now I have an issue where the Carthage dependecy links to the "<code>WebImage</code>" framework and a project which uses my framework is linked via Cocoapods to "<code>SDWebImage</code>".</p>
  
  <p>I already switched the linkage to WebImage to weak via <code>-weak_framework WebImage</code> so I don't get linking errors, but the problem remains.</p>
  
  <p>In my framework I import the WebImage source via</p>
  
  <pre><code>#import &lt;WebImage/SDWebImageManager.h&gt;
  </code></pre>
  
  <p>Which is not found on runtime, because it requires <code>SDWebImage/SDWebImageManager.h</code>. Because of weak-linking I don't get any errors, but all the objects are nil and therefore nothing is executed.</p>
  
  <p>It seems I could counter this problem somehow via runtime checks, obviously, but how do I do that if the symbol-names are the same, just with different namespaces? Is there somehow a way to "conditionally" use SDWebImage if available and WebImage otherwise?</p>
  
  <p>I also tried (weak) linking to both the SDWebImage framework and WebImage, importing headers from both sources, but obviously that is neither very clean nor does it work, it seems SDWebImageManager is resolved/linked to whichever import comes first.</p>
  
  <p>Anyone has an idea or had the problem with SDWebImage before?</p>