title: Swift UIImageView is above all other views
body: <p>I have a problem in Swift where I put a UIImageView on my view in Main.storyboard. I want to use this UIImageView as a background image and therefore I want it on the bottom of the "stack of components". Unfortunately this UIImageView seems to be on the top of everything and not showing my UIPickerView and UIButtons. If i resize the UIImageView you can see what i mean by looking at the picture I attached.</p>
  
  <p>Does anyone know how to solve this problem and set the UIImageView on the bottom, and all my other components above it? </p>
  
  <p><img src="https://i.stack.imgur.com/zqAEr.png" alt="The purple image is the one I want to use as background image"></p>
  
  <p><strong>Answer:</strong>
  Thanks everyone, I fixed it by changing the backgroundview of the collectionview to the backgroundview. Here is the code:</p>
  
  <pre><code>    var imageViewObject :UIImageView!
      imageViewObject = UIImageView(frame: CGRectMake(0, 0, viewSize.width, viewSize.height))
      imageViewObject.image = UIImage(named:"intro.jpg")
  
  collectionView = UICollectionView(frame: self.view.frame, collectionViewLayout: layout)
  collectionView!.dataSource = self
  collectionView!.delegate = self
  collectionView!.registerClass(NameCell.self, forCellWithReuseIdentifier: "Cell")
  collectionView!.backgroundView = imageViewObject
  backgroundView.addSubview(collectionView!)
  </code></pre>