I have a root UIViewController that handles multiple sub UIViewControllers. The root view is a custom tab bar that does not rotate. I want the sub controllers to rotate with orientation changes.
From some testing, I’ve learned that the root controller handles all orientation changes for its sub controllers. So I need to implement a custom animation that would mimic a standard device orientation change, that I can apply to the visible view and, use to transform all non-visible views.
The visible sub controller’s view is added as a sub view to the root’s “contentView”. There is only one sub controller view in the “contentView” at a time. The rest are in an array.
How would I do something like this? That supports iOS 5 and 6. I know I need to preform a CGTransformation to rotate the view, and resize the frame to match. Mainly, I’m not sure what steps I need to take to ensure proper functioning of the sub controllers.
I figured out that after applying CGAffineTransformations to a UIView, you can no longer reliably edit the view’s frame. you need to use the bounds instead. keeping the origin of the bounds the same, and changing the size, you can change the view’s size after a Pi/2 rotation. Good for faking a UIDevice rotation change, or responding to one in a root view that does’n allow for orientation changes.