title: CALayer renderInContext iOS7
body: <p>I'm rendering multiple layers to get one final image. One of the images contains a face, and another one contains a background with a transparent gradient around the face so that the real background is hidden. In iOS6 it works perfectly but it is creating a weird effect with the transparent gradient in iOS7.</p>
  
  <p>The code:</p>
  
  <pre><code>CGRect rect = [[UIScreen mainScreen] bounds];
  UIGraphicsBeginImageContext(rect.size);
  
  CGContextRef context = UIGraphicsGetCurrentContext();
  
  [faceImageView.layer renderInContext:context];
  [fakeBackgroundImageView.layer renderInContext:context];
  
  UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
  UIGraphicsEndImageContext();
  </code></pre>
  
  <p>The results in iOS6 and iOS7:</p>
  
  <p><img src="https://i.stack.imgur.com/PWXP5.png" alt="ios6"></p>
  
  <p><img src="https://i.stack.imgur.com/Ih7AO.png" alt="ios7"></p>