I have written a code which should turn UILabel by Z axis and then by Y axis to simulate perspective. Here is the sample code:
var t: CATransform3D = CATransform3DIdentity
t = CATransform3DRotate(t, 270 * CGFloat.pi / 180, 0, 0, 1) // rotate by z axis
t = CATransform3DRotate(t, -50 * CGFloat.pi / 180, 0, 1, 0) // rotate by y axis
t.m34 = 1.0 / -500
logLabel.transform3D = t // implement sequence of rotations to label
contentView.addSubview(logLabel)
It rotates by Z axis correctly, but it does not rotate by Y axis. The second rotation makes the label to look narrow. How to simulate perspective?