title: Swift UIView background color opacity
body: <p>I have a <code>UIView</code> with a <code>UILabel</code> in it. I want the UIView to have white background color, but with an opacity of 50%. The problem whith setting <code>view.alpha = 0.5</code> is that the label will have an opacity of 50% as well, so I figured out that it maybe would be possible to have a <code>UIView</code> with white background color and opacity (white_view), and then have another <code>UIView</code> with the label (label_view). Then add the "white_view" to "label_view" by doing this: <code>label_view.addSubview(white_view)</code>. This apparently doesn't work. I'd like to do like: <code>label_view.backgroundView(white_view)</code> but you can't set a background view on a <code>UIView</code> like you can do in a <code>UICollectionView</code> for instance.</p>
  
  <p>Does anyone have any clue of how to solve this?</p>
  
  <p><strong>EDIT</strong>
  Because several answers are approx the same I'll type it here.
  Now I've tried even these:</p>
  
  <pre><code>label_view1.backgroundColor = UIColor.whiteColor().colorWithAlphaComponent(0.5)
  label_view1.addSubview(firstPlacelbl)
  endGameView.addSubview(label_view1)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>label_view1.backgroundColor = UIColor(white: 1, alpha: 0.5)
  label_view1.addSubview(firstPlacelbl)
  endGameView.addSubview(label_view1)
  </code></pre>
  
  <p>And still the label is also affected by the alpha, and it gets an opacity of 50%. I don't get it what I do wrong because I only set the colors alpha to 0.5 and not the labels. Any ideas?</p>