У меня есть UIView, который я пытаюсь сделать в UIImage, используя [CALayer renderInContext:]. Однако я обнаружил, что результирующее изображение перевернуто вертикально. Я как бы ожидаю этого из-за разных систем координат. Тем не менее, я затем пытаюсь перевернуть контекст обратно к нормальному с аффинным преобразованием - но это не имеет никакого эффекта:
CGAffineTransform flipVertical = CGAffineTransformMake(
1, 0, 0, -1, 0, imageContextHeight
);
CGContextConcatCTM(imageContext, flipVertical);
CGImageRef cgImage = CGBitmapContextCreateImage(imageContext);
UIImage* uiImage = [[UIImage imageWithCGImage:cgImage] retain];
CGImageRelease(cgImage);
Что я делаю неправильно?