title: Swift @import of module '<module name>' in implementation of <Project name>; use #import
body: <p>I'm trying to create a mixed ObjC-Swift framework. But I'm losing a lot of hairs trying to make a private module for my Swift files.</p>
  
  <p>I followed some steps in <a href="https://stackoverflow.com/questions/34998570/ios-mixed-dynamic-framework-bridge-objc-headers-with-private-module">iOS mixed dynamic framework - bridge objc headers with private module</a> combined with some steps in <a href="https://stackoverflow.com/a/36878037/749438">https://stackoverflow.com/a/36878037/749438</a></p>
  
  <p>Basically I have a module.modulemap now which has the following content:</p>
  
  <pre><code>module MyCore {    //Adding 'framework' before module is giving me an "Umbrella not found"-error :/
  umbrella header "MyCore.h"
  
  export *
  module * { export * }
  
  explicit module MyCorePrivate {
      header "MyCore_PrivateUmbrella.h"
      export *
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The <code>MyCore_PrivateUmbrella.h</code> imports all headers I want to privately expose to my Swift code. The reason behind it is just that it's easier to include 1 header in the module then <em>all</em> the to-be-exposed headers (since you need to include the specific paths to the headers...).</p>
  
  <p>My build settings look like:</p>
  
  <ul>
  <li><code>DEFINES_MODULE</code>: YES</li>
  <li><code>PRODUCT_MODULE_NAME</code>: MyCore</li>
  <li><code>CLANG_ENABLE_MODULES</code>: YES</li>
  <li><code>SWIFT_OBJC_INTERFACE_HEADER_NAME</code>: MyCore-Swift.h</li>
  <li><code>SWIFT_INCLUDE_PATHS</code>: <em>path to the directory of the <code>module.modulemap</code></em></li>
  </ul>
  
  <p>and last but not least; <code>ALWAYS_SEARCH_USER_PATHS</code> is set to NO</p>
  
  <p>In my Swift files I import the module using <code>import MyCore.MyCorePrivate</code>. This works as expected and I can use my code from Objective-C.<br>
  Building the project gives me an error like this (the black bars only hide the project name and path to the file):  </p>
  
  <p><a href="https://i.stack.imgur.com/iU0fh.png" rel="noreferrer"><img src="https://i.stack.imgur.com/iU0fh.png" alt="what is this error?"></a></p>
  
  <p>Now clicking the error brings me to the generated <code>MyCore-Swift.h</code> where the <code>@import MyCore.MyCorePrivate</code> is seemingly wrong.</p>
  
  <p>I've got no idea as of why it's wrong, neither do I know how to fix this. Especially since it's a file generated by XCode.</p>
  
  <p>Does anyone knows what's going down here?</p>