title: Can not render SwiftUI preview from Cocoapods
body: <p>I have a <code>SwiftUI</code> struct in a common library that I ship to myself.</p>
  
  <pre class="lang-swift prettyprint-override"><code>public struct NTextField: View {
      public var body: some View {
          Text("Hello, World!")
      }
  
      public init() {
  
      }
  }
  
  struct NTextField_Previews: PreviewProvider {
      static var previews: some View {
          NTextField()
      }
  }
  </code></pre>
  
  <p>I click on the file and the WYSIWYG preview fails to load</p>
  
  <p><a href="https://i.stack.imgur.com/TTicK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TTicK.png" alt="enter image description here"></a></p>
  
  <p>When clicking 'Diagnostics' I see something like this:</p>
  
  <pre class="lang-sh prettyprint-override"><code>Error Domain=com.apple.dt.UITestingAgent Code=-1 "failed to load library at path "/Users/&lt;my_app_name&gt;/Library/Developer/Xcode/DerivedData/&lt;my_app_name&gt;/Build/Intermediates.noindex/Previews/&lt;my_app_name&gt;/Products/Debug-iphonesimulator/&lt;my_custom_pod&gt;/&lt;my_custom_pod&gt;.framework/&lt;my_custom_pod&gt;": Library not loaded: 
  </code></pre>
  
  <p>Any ideas? I deleted derived data, cleaned and built.</p>
  
  <p>Also found <a href="https://github.com/CocoaPods/CocoaPods/issues/9275" rel="noreferrer">this on the cocoapods git hub issue tracker</a>.</p>