How do I rotate a CALayer 90 degrees? I need to rotate everything include sublayers and the coordinate system.
Obj-C:
theLayer.transform = CATransform3DMakeRotation(90.0 / 180.0 * M_PI, 0.0, 0.0, 1.0);
Swift:
theLayer.transform = CATransform3DMakeRotation(90.0 / 180.0 * .pi, 0.0, 0.0, 1.0)
That is, transform the layer such that it is rotated by 90 degrees (π / 2 radians), with 100% of that rotation taking place around the z-axis.