title: Retrieving image from asset folder - iOS
body: <p>I'm writing a class to build a cocoapods and I want to get the image I placed in <code>Assets.xcassets</code>. The problem is always getting <code>nil</code> image. Are there anything I miss?</p>
  
  <p>Here is my <code>podspec</code> file :
  <a href="https://i.stack.imgur.com/2HccE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2HccE.png" alt="enter image description here"></a></p>
  
  <p>Here is the directory stucture : 
  <a href="https://i.stack.imgur.com/kc1Vr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kc1Vr.png" alt="enter image description here"></a></p>
  
  <p>This is what I try to load the Image:</p>
  
  <pre><code>#import "HaloImage.h"
  
  @implementation HaloImage
  - (void)showImage {
      NSBundle * bundle = [NSBundle bundleForClass:self];
      NSURL * bundleUrl = [bundle URLForResource:@"Assets" withExtension:@"bundle"];
      self.image = [UIImage imageNamed:bundleUrl.absoluteString];
  }
  @end
  </code></pre>