title: How to build framework with xcassets
body: <p>I tried to build an framework with its own image and it compiles fine. However, when I include my framework in another project, it crashes when loading the image, any idea?</p>
  
  <p><strong>ImageTest (my framework)</strong></p>
  
  <pre><code>public class ImageTest {
      open func getImage() {
          return #imageLiteral(resourceName: "IMG_0745")
      }
  }
  </code></pre>
  
  <p><strong>My project</strong></p>
  
  <pre><code>import ImageTest
  ...
  ...
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      let imageView = UIImageView(image: ImageTest.getImage()) // crash !
      imageView.center = view.center
      view.addSubview(imageView)
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9IZjw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9IZjw.png" alt="enter image description here"></a></p>