Logo Questions Linux Laravel Mysql Ubuntu Git Menu

Rotate UIView in Storyboard with iOS6

I have a UILabel I want rotated 180 degrees, so the text appears upside down. I did some searching and found this question that covers rotations with CGAffineTransformMakeRotation.

Is there a way to rotate it right on my UIStoryboard? The label is always going to appear with that same fixed rotation, so it would be nice to have it just show up the same way in my storyboard as it does when running. I found this post saying it's impossible, but that's a pretty old post (I think pre-storyboard). Of course if it's not with a storyboard, I can just use CGAffineTransformMakeRotation like in the other question I linked in my viewDidLoad.

like image 955
GeneralMike Avatar asked Mar 25 '23 06:03


1 Answers

No, there's no way to do that; you have to apply the transform in code (and, as you say, viewDidLoad is a good place).

The storyboard/nib editor is remarkably good, but there is still a lot of stuff you can do to a view that you can do only in code, and that applies to specific UIView subclasses as well. And of course you can't access a view's underlying layer in the storyboard/nib editor at all either; for example, you can't give the view rounded corners in the storyboard/nib.

like image 107
matt Avatar answered Apr 06 '23 18:04