title: Load Image programmatically in swift
body: <p>I have an ImageView. This is the code I am using to add image to the ImageView</p>
  
  <pre><code> var imgstr = pf["ImageFileName"] as String
   image = UIImage(named: imgstr)!
   println(imgstr) //the output here is abc.png
   self.Imageview.image = image
  </code></pre>
  
  <p>Now I have the image in my Project folder as you can see in the screenshot<img src="https://i.stack.imgur.com/czkp2.png" alt="Screenshot"></p>
  
  <p>Still I am getting this error at run time</p>
  
  <blockquote>
    <p>fatal error: unexpectedly found nil while unwrapping an Optional value</p>
  </blockquote>