I have the following controllers and views in my project:
PortraitController.m
PortraitView.xib
LandscapeController.m
LandscapeView.xib
Portrait controller is used as a controller for the portrait view, and a landscape controller is used as a controller for the landscape view.
I need to switch BOTH controller and view when device orientation changes. This approach is advised by Apple, but they do not provide an usable, general example of this!
I have found various examples, but they are not quite what I need - one controller + two views in same xib, push+pop from navigation controller, place second view over previous, ... none of them is what I need.
What is the simplest way to switch (with animation) between these two Controller+View combinations when device orientation changes?
Is there a solution which can work for both iOS 5 and iOS 6?