In ios, where's the best place in a view controller to move your custom subviews around to handle rotations? (of course this is only for those where the autoresizingflags don't help).
Here's the following places i've tried, and the issues each has:
- willAnimateRotationToInterfaceOrientation:duration
This works, and any subview frame changes you make are animated nicely as the device is rotated landscape<->portrait. However, if you're in a tab controller, this doesn't get called when another VC is visible. And so if you rotate, and switch back to this tab, it'll have the wrong layout.
- viewWillAppear
Doesn't really help, because this gets called before the rotation takes effect, so when accessing self.view.frame you get the pre-rotation sizing, so you can't know whether we're going for landscape or portrait
- viewDidAppear
This is better than viewWillAppear, however because it gets called after the view goes on screen, you see a flash of content in the wrong layout before it flicks across.
I just want to know where the proper place is to put my code that lays out my view controller's subviews nicely to handle both layouts, animated nicely. THanks all