I am trying to rotate a UILabel using this code,
self.itemlistLabel.text = "Playlist"
self.itemlistLabel.transform = CGAffineTransform(rotationAngle: -CGFloat.pi / 2)
This rotates the label, but this is not setting the label correctly inside the view, I have added a blue background colour to the label,
This is the screenshot from Xcode with the layouts set, but after applying transform this is not displaying as expected. How to fix this?


