title: Why is my image not loading correctly in Swift
body: <p>I've stored <code>B1.png</code> named image in <code>Images.xcassets</code> folder.</p>
  
  <p>Here's my code.</p>
  
  <pre><code>class ViewController: UIViewController {
  
      var imageView:UIImageView = UIImageView()
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          let width:CGFloat = 320;
          let height:CGFloat  = 568;
          var buttonTitles = ["Click to begin"]
          var view:UIView = UIView(frame: CGRectMake(0,0,width,height))
          self.view.addSubview(view);
          var backgroundImage:UIImage = UIImage(named:"B1")
          imageView = UIImageView(frame: view.frame)
          imageView.image = backgroundImage
          view.addSubview(imageView)
      }
  }
  </code></pre>
  
  <blockquote>
    <p><strong>Problem:</strong> when I run the project it builds with no errors but only displays a white screen in the simulator.</p>
  </blockquote>