title: Transparency issue - when converting UIView to UIImage
body: <p>I want to create an <code>UIImage</code> object from a <code>UIView</code>. The view is NOT opaque.
  for that i'm using the following code:</p>
  
  <pre><code>+ (UIImage *) imageWithView:(UIView *)view 
  {     
      UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, [[UIScreen mainScreen] scale]);     
      [view.layer renderInContext:UIGraphicsGetCurrentContext()];     
      UIImage * img = UIGraphicsGetImageFromCurrentImageContext();  
      UIGraphicsEndImageContext();     
      return img; 
  }  
  </code></pre>
  
  <p>But for some reason instead of transparent background i'm getting a image with black background.
  I already tried to set the "opaque" parameter in <code>UIGraphicsBeginImageContextWithOptions</code> to <code>NO</code> but with no different results.</p>
  
  <p>Any suggestion? </p>
  
  <p>(Similar question <a href="https://stackoverflow.com/questions/4525127/cgcontext-transparency-problem">CGContext transparency problem</a> with no answer)</p>