title: Vertical flip of CGContext
body: <p>I have a UIView that I am trying to render into a UIImage using [CALayer renderInContext:]. However, I find that the resultant image is flipped vertically. I kind of expect this due to the different coordinate systems. However, I then try and flip the context back to normal with an affine transform - but it doesn't have any effect:</p>
  
  <pre><code>CGAffineTransform flipVertical = CGAffineTransformMake(
      1, 0, 0, -1, 0, imageContextHeight
  );
  CGContextConcatCTM(imageContext, flipVertical);
  CGImageRef cgImage = CGBitmapContextCreateImage(imageContext);
  UIImage* uiImage = [[UIImage imageWithCGImage:cgImage] retain];
  CGImageRelease(cgImage);
  </code></pre>
  
  <p>What am I doing wrong?</p>