title: UIView alpha vs. UIColor alpha
body: <p>I would like to know the difference between:</p>
  
  <ul>
  <li>Assigning my UIView a color with &lt;1 alpha vs </li>
  <li>Assigning it a non-transparent color but giving the UIView a &lt;1 alpha value. </li>
  </ul>
  
  <p>On the screenshot I have made two UIViews with two black (alpha = 1.0) UILabels on top of each:</p>
  
  <p><img src="https://i.stack.imgur.com/l6BGz.png" alt="Two UIView&#39;s with same color but 0.5 alpha on UIView and bg. color and a third one with alpha 1"></p>
  
  <p>Assume a macro _RGB is defined before:</p>
  
  <pre><code>#define _RGB(r,g,b,a) [UIColor colorWithRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:a]
  </code></pre>
  
  <p>and then here is the code::</p>
  
  <pre><code>[_view1 setBackgroundColor:_RGB(255, 0, 0, 1)];
  [_view1 setAlpha:0.5];
  
  [_view2 setBackgroundColor:_RGB(255, 0, 0, 0.5)];
  [_view2 setAlpha:1];
  
  [_view3 setBackgroundColor:_RGB(255, 0, 0, 1)];
  [_view3 setAlpha:1];
  </code></pre>
  
  <p>I can see only one difference visually: Changing view's own alpha instead of bg color's, affects the subviews as well. But other than that is there any difference in functionality that I should consider? (eg. On animations, layers, etc.)</p>