title: Create a static library with React dependency
body: <p>I created a library that uses the native navigation controller to navigate through react and native screens. The library is written in Swift and contains some objective-c code to setup the React bridge etc. Currently I can distribute this library through CocoaPods by creating a podspec and defining the React dependency there. However, this forces the user to setup React in their project through CocoaPods as well (like so: <a href="https://facebook.github.io/react-native/docs/integration-with-existing-apps.html" rel="noreferrer">https://facebook.github.io/react-native/docs/integration-with-existing-apps.html</a>). I'd like them to use the <code>react-native link</code> or manually linking option as well (like so: <a href="https://medium.com/@joshyhargreaves/adding-react-native-to-existing-ios-project-without-cocoapods-6f1ee9106009" rel="noreferrer">https://medium.com/@joshyhargreaves/adding-react-native-to-existing-ios-project-without-cocoapods-6f1ee9106009</a>).</p>
  
  <p>If I understand correctly I can create a static library and distribute that. So far I created this static library, added my mixed swift and objective-c code and tried to manually link it into my main project. This however produces an error in one of my classes inside my static library where I import React like so <code>import React</code>. Error is <code>"No such module 'React'</code>.</p>
  
  <p>I updated the Header Search Paths of my static library to contain:</p>
  
  <p><code>$(SRCROOT)/../react-native/React</code>
  and
  <code>$(SRCROOT)/../React</code></p>
  
  <p>(react-native, React and my own lib are all inside the node_modules folder)</p>
  
  <p>both set to recursive. Unfortunately it still doesn't find the module React. Does anyone know how to create a static library that contains a dependency with React?</p>
  
  <p>The end goal would be to import this static library in my main project like <code>import MyStaticNaivationLib</code> in one of my viewcontrollers and subclass from a class that's defined in my static library.</p>
  
  <p>My main project also uses <a href="https://github.com/rebeccahughes/react-native-device-info" rel="noreferrer">https://github.com/rebeccahughes/react-native-device-info</a>. This looks exactly what I want to achieve. It's a static library that has a dependency with React ("import RCTBridgeModule.h") which I can manually link in my main project. Only difference is that this project doesn't contain Swift code.</p>