title: How to selectively import a module in Swift depending on target?
body: <p>Our Xcode project contains a sub-project that builds first party frameworks which we use as our standard libraries. One is built for each platform (iPhone, iPad, watchOS,...) but there is significant overlap between them (extensions for example).</p>
  
  <p>In our Objective-C code in the main project, I simply have a different prefix header for each target based on its platform, and I import the relevant framework header. This means in my entire project I can use all the symbols that are in our "standard library".</p>
  
  <p>I want this to happen in our Swift code as well (for both Swift and Objective-C symbols). From what I'm aware, Swift doesn't have the concept of prefix headers, so I'm needing to import the framework/module manually in each file. </p>
  
  <p>What's more annoying, my imports won't just need to be</p>
  
  <pre><code>import MyFrameworkForiPhone
  </code></pre>
  
  <p>But because of the platform specific frameworks, with the help of Swift compiler flags, they'll need to become</p>
  
  <pre><code>#if RD_IPHONE
  import MyFrameworkForiPhone
  #elseif RD_IPAD
  import MyFrameworkForiPad
  #endif
  </code></pre>
  
  <p>Does anyone have any suggestions about how to cleanly work around this problem, or am I stuck with this for the time being?</p>