myButton.titleLabel?.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2) myButton.transform = CGAffineTransform(rotationAngle: CGFloat.pi / 2)