CATransform3DRotate flip horizontal

calayer, catransform3d, ios, objective-c

Solution

You'll need:

self.customLayer.transform = CATransform3DScale(CATransform3DMakeRotation(M_PI / 2.0f, 0, 0, 1),
                                                -1, 1, 1);

A scale with -1 is a flip. Imagine you're squashing the image horizontally and you go past zero.

Problem

I have a layer that I need to transform. Currently I am using the following: ``` self.customLayer.transform = CATransform3DRotate(CATransform3DIdentity,M_PI / 2.0f, 0, 0, 1); ``` This correctly makes the layer right side up, but it also needs to be flipped horizontally, since it is the wrong way. How can I adjust `CATransform3DRotate` to do this?

Original source